sox-compliance-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +829 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# sox-compliance-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for **Sarbanes-Oxley (SOX) compliance** — browse internal control requirements, assess audit readiness, generate ITGC and business process control policies, evidence checklists, gap analysis, and deficiency evaluation for public companies.
|
|
4
|
+
|
|
5
|
+
Built for compliance teams, internal auditors, SOX program managers, and external audit support.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `browse_controls` | Browse SOX controls by section (302/404), category (ITGC/business process/entity-level/disclosure), COSO component, or control type |
|
|
12
|
+
| `assess_readiness` | Score compliance readiness based on implemented controls with filer-category-aware recommendations |
|
|
13
|
+
| `generate_policy` | Generate detailed policy documents for any SOX control with implementation guidance |
|
|
14
|
+
| `evidence_checklist` | Generate evidence collection checklists, walkthrough templates, or testing matrices |
|
|
15
|
+
| `gap_analysis` | Compare implemented controls vs. requirements with prioritized remediation timeline |
|
|
16
|
+
| `evaluate_deficiency` | Classify deficiencies as material weakness, significant deficiency, or control deficiency per PCAOB AS 2201 |
|
|
17
|
+
|
|
18
|
+
## Controls Coverage
|
|
19
|
+
|
|
20
|
+
- **IT General Controls (ITGC):** Access management, authentication, privileged access, change management (application + infrastructure), SoD, job scheduling, backup/recovery
|
|
21
|
+
- **Business Process Controls:** Journal entries, account reconciliation, financial close, revenue recognition (ASC 606), vendor master, three-way match
|
|
22
|
+
- **Entity-Level Controls:** CEO/CFO Section 302 certification, risk assessment, management review/monitoring, audit committee (Section 301)
|
|
23
|
+
- **Disclosure Controls:** Section 409 real-time disclosure, Section 802 record retention, Section 806 whistleblower protection
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx sox-compliance-mcp
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Claude Desktop
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"sox-compliance": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "sox-compliance-mcp"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
|
|
46
|
+
Browse all ITGC controls:
|
|
47
|
+
```
|
|
48
|
+
browse_controls({ category: "itgc" })
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Assess readiness for an accelerated filer:
|
|
52
|
+
```
|
|
53
|
+
assess_readiness({ implementedControls: ["ITGC-01", "ITGC-02", "BP-01", "EL-01"], companyType: "accelerated_filer" })
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Generate a change management policy:
|
|
57
|
+
```
|
|
58
|
+
generate_policy({ controlId: "ITGC-04", companyName: "Acme Corp" })
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Get a walkthrough template for business process controls:
|
|
62
|
+
```
|
|
63
|
+
evidence_checklist({ category: "business_process", format: "walkthrough" })
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Evaluate a deficiency:
|
|
67
|
+
```
|
|
68
|
+
evaluate_deficiency({ deficiencyDescription: "Quarterly access reviews not completed for ERP system", controlId: "ITGC-01", financialStatementImpact: "more_than_inconsequential", likelihoodOfOccurrence: "reasonably_possible", compensatingControls: false })
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,829 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
// ── SOX Controls Database ─────────────────────────────────────────────
|
|
6
|
+
const SOX_CONTROLS = [
|
|
7
|
+
// ── IT GENERAL CONTROLS (ITGC) ─────────────────────────────────────
|
|
8
|
+
{
|
|
9
|
+
id: "ITGC-01",
|
|
10
|
+
section: "404",
|
|
11
|
+
title: "Logical Access — User Provisioning",
|
|
12
|
+
description: "Formal procedures for granting, modifying, and revoking access to financially significant applications and databases.",
|
|
13
|
+
category: "itgc",
|
|
14
|
+
coso: "control_activities",
|
|
15
|
+
type: "preventive",
|
|
16
|
+
frequency: "per_transaction",
|
|
17
|
+
assertion: ["existence", "completeness", "rights_obligations"],
|
|
18
|
+
implementation: "Establish formal access request process with documented approvals. Require manager authorization for all access grants. Map access roles to job functions. Implement segregation of duties in role design. Automated provisioning/deprovisioning tied to HR events. Quarterly access review with sign-off.",
|
|
19
|
+
evidence: ["Access request forms with approvals", "Role-to-function mapping matrix", "Quarterly access review reports (signed)", "User provisioning/deprovisioning logs", "Segregation of duties conflict reports", "Terminated user access removal evidence"],
|
|
20
|
+
commonDeficiencies: ["Access granted without documented approval", "Terminated employees retain active access", "Quarterly access reviews not performed or not signed off", "Generic/shared accounts in production", "Segregation of duties conflicts not identified or remediated", "Service accounts with excessive privileges"],
|
|
21
|
+
testingApproach: "Select sample of new hires, terminations, and transfers. Verify access request approvals. Confirm termination access removal within SLA. Review quarterly access certification for completeness. Test for SoD conflicts. Verify generic accounts are documented with compensating controls.",
|
|
22
|
+
policyTemplate: "[Organization] maintains formal access management procedures for all financially significant applications. Access requests require documented approval from [role]. Access is provisioned based on role-based access control (RBAC) aligned with job function. Quarterly access reviews are completed by [role] with sign-off by [approver]. Access is removed within [N] hours of termination notification from HR. Segregation of duties conflicts are monitored using [tool/process].",
|
|
23
|
+
relatedControls: ["ITGC-02", "ITGC-03", "BP-01"],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "ITGC-02",
|
|
27
|
+
section: "404",
|
|
28
|
+
title: "Logical Access — Authentication Controls",
|
|
29
|
+
description: "Password policies, multi-factor authentication, and session management for financially significant systems.",
|
|
30
|
+
category: "itgc",
|
|
31
|
+
coso: "control_activities",
|
|
32
|
+
type: "preventive",
|
|
33
|
+
frequency: "continuous",
|
|
34
|
+
assertion: ["existence", "rights_obligations"],
|
|
35
|
+
implementation: "Enforce minimum password complexity (12+ chars, mixed case, numbers, symbols). Password rotation per policy. Multi-factor authentication for privileged access and remote access. Account lockout after failed attempts. Session timeout for inactive sessions. No shared passwords. Privileged access management (PAM) for admin accounts.",
|
|
36
|
+
evidence: ["Password policy configuration screenshots", "MFA enrollment reports", "Account lockout configuration", "Session timeout settings", "PAM solution reports", "Failed login attempt monitoring"],
|
|
37
|
+
commonDeficiencies: ["Password policy not enforced in all systems", "MFA not enabled for privileged accounts", "No account lockout configured", "Shared administrator passwords", "No PAM solution for privileged access", "Session timeouts too long or not configured"],
|
|
38
|
+
testingApproach: "Inspect password policy configuration in each in-scope system. Verify MFA enrollment for all privileged users. Test account lockout functionality. Review session timeout settings. Verify PAM usage for admin activities. Check for shared/generic accounts.",
|
|
39
|
+
policyTemplate: "[Organization] enforces strong authentication controls across all financially significant systems. Passwords must meet minimum complexity requirements of [requirements]. Multi-factor authentication is required for [scope]. Accounts lock after [N] failed attempts. Sessions timeout after [N] minutes of inactivity. Privileged access is managed through [PAM solution] with just-in-time provisioning.",
|
|
40
|
+
relatedControls: ["ITGC-01", "ITGC-03"],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "ITGC-03",
|
|
44
|
+
section: "404",
|
|
45
|
+
title: "Logical Access — Privileged Access Management",
|
|
46
|
+
description: "Controls over elevated/administrative access to operating systems, databases, and applications supporting financial reporting.",
|
|
47
|
+
category: "itgc",
|
|
48
|
+
coso: "control_activities",
|
|
49
|
+
type: "preventive",
|
|
50
|
+
frequency: "continuous",
|
|
51
|
+
assertion: ["existence", "rights_obligations", "completeness"],
|
|
52
|
+
implementation: "Separate privileged accounts from standard user accounts. Just-in-time privileged access with time-limited sessions. Privileged access monitored and logged. Break-glass procedures documented and tested. Regular review of privileged access holders. Background checks for privileged users.",
|
|
53
|
+
evidence: ["Privileged account inventory", "PAM session logs", "Break-glass procedure documentation", "Privileged access review reports", "Background check records for admins", "Monitoring alerts for privileged activity"],
|
|
54
|
+
commonDeficiencies: ["Developers with production database admin access", "No privileged access monitoring", "Break-glass accounts used routinely", "No periodic review of privileged users", "Standing admin access instead of just-in-time", "No separation between admin and user accounts"],
|
|
55
|
+
testingApproach: "Obtain privileged user listing for all in-scope systems. Verify business need and authorization for each. Review PAM logs for appropriateness. Test break-glass procedure and review usage. Verify monitoring of privileged activities.",
|
|
56
|
+
policyTemplate: "[Organization] manages privileged access through dedicated controls separate from standard access management. Privileged accounts are inventoried and reviewed [frequency]. Just-in-time access is enforced via [PAM tool]. All privileged sessions are logged and monitored. Break-glass procedures require [process] and are reviewed after each use.",
|
|
57
|
+
relatedControls: ["ITGC-01", "ITGC-02"],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "ITGC-04",
|
|
61
|
+
section: "404",
|
|
62
|
+
title: "Change Management — Application Changes",
|
|
63
|
+
description: "Formal procedures for requesting, developing, testing, approving, and deploying changes to financially significant applications.",
|
|
64
|
+
category: "itgc",
|
|
65
|
+
coso: "control_activities",
|
|
66
|
+
type: "preventive",
|
|
67
|
+
frequency: "per_transaction",
|
|
68
|
+
assertion: ["completeness", "accuracy", "existence"],
|
|
69
|
+
implementation: "Formal change request process with business justification. Separate development, test, and production environments. Code review by independent reviewer. User acceptance testing (UAT) with sign-off. Management approval before production deployment. Post-implementation verification. Emergency change procedures with retroactive approval.",
|
|
70
|
+
evidence: ["Change request tickets with approvals", "Code review documentation", "UAT sign-off records", "Deployment approval records", "Environment separation evidence", "Post-implementation verification records", "Emergency change documentation"],
|
|
71
|
+
commonDeficiencies: ["Changes deployed without testing documentation", "No UAT sign-off from business", "Developer access to production (no SoD)", "Emergency changes without retroactive approval", "No independent code review", "Test environment not representative of production"],
|
|
72
|
+
testingApproach: "Select sample of changes deployed during audit period. Trace each from request through approval, development, testing, UAT, deployment approval, and post-implementation review. Verify SoD between development and deployment. Review emergency changes for retroactive approval.",
|
|
73
|
+
policyTemplate: "[Organization] requires all changes to financially significant applications to follow the formal change management process. Changes require: (1) documented business request, (2) independent code review, (3) testing in non-production environment, (4) UAT sign-off from business owner, (5) deployment approval from [role], (6) post-implementation verification. Emergency changes follow expedited procedures with retroactive approval within [N] business days.",
|
|
74
|
+
relatedControls: ["ITGC-05", "ITGC-06", "ITGC-01"],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "ITGC-05",
|
|
78
|
+
section: "404",
|
|
79
|
+
title: "Change Management — Infrastructure Changes",
|
|
80
|
+
description: "Controls over changes to operating systems, databases, networks, and middleware supporting financial applications.",
|
|
81
|
+
category: "itgc",
|
|
82
|
+
coso: "control_activities",
|
|
83
|
+
type: "preventive",
|
|
84
|
+
frequency: "per_transaction",
|
|
85
|
+
assertion: ["completeness", "accuracy"],
|
|
86
|
+
implementation: "Change Advisory Board (CAB) review for infrastructure changes. Impact assessment for financially significant systems. Rollback plan required. Maintenance windows defined. Patch management with testing before production. Configuration management database (CMDB) updates.",
|
|
87
|
+
evidence: ["CAB meeting minutes", "Change tickets with impact assessments", "Rollback plans", "Patch testing records", "CMDB update logs", "Maintenance window schedules"],
|
|
88
|
+
commonDeficiencies: ["Infrastructure changes bypass CAB review", "No impact assessment for financial systems", "Missing rollback plans", "Patches applied to production without testing", "CMDB out of date", "No post-change verification"],
|
|
89
|
+
testingApproach: "Review CAB minutes and change tickets for infrastructure changes. Verify impact assessment for financial systems. Confirm rollback plans exist. Review patch management process and testing evidence. Verify CMDB accuracy against actual infrastructure.",
|
|
90
|
+
policyTemplate: "[Organization] manages infrastructure changes through a formal change management process. The Change Advisory Board meets [frequency] to review proposed changes. All changes affecting financially significant systems require impact assessment and rollback plan. Patches are tested in [environment] before production deployment. The CMDB is updated within [N] days of any change.",
|
|
91
|
+
relatedControls: ["ITGC-04", "ITGC-06"],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "ITGC-06",
|
|
95
|
+
section: "404",
|
|
96
|
+
title: "Change Management — Segregation of Duties",
|
|
97
|
+
description: "Separation between those who develop/configure changes and those who promote to production for financially significant systems.",
|
|
98
|
+
category: "itgc",
|
|
99
|
+
coso: "control_activities",
|
|
100
|
+
type: "preventive",
|
|
101
|
+
frequency: "continuous",
|
|
102
|
+
assertion: ["existence", "rights_obligations"],
|
|
103
|
+
implementation: "Developers cannot deploy to production. Operations team manages production deployments. Automated deployment pipelines enforce separation. No developer access to production data. Documented exceptions with compensating controls. Regular SoD conflict scanning.",
|
|
104
|
+
evidence: ["Environment access matrices", "Deployment pipeline configuration", "SoD conflict reports", "Exception documentation with compensating controls", "Production access logs vs. development team roster"],
|
|
105
|
+
commonDeficiencies: ["Developers have production deployment access", "Same person approves and deploys", "Automated pipelines bypassed", "No monitoring of SoD violations", "Exceptions without compensating controls"],
|
|
106
|
+
testingApproach: "Review environment access for all in-scope systems. Compare developer list against production deployment access. Review deployment logs to verify separation. Test automated pipeline controls. Review exception documentation.",
|
|
107
|
+
policyTemplate: "[Organization] enforces segregation of duties between development and production environments. Developers do not have access to deploy changes to production. Production deployments are executed by [operations team/automated pipeline]. Exceptions require documented compensating controls approved by [role]. SoD conflicts are scanned [frequency] using [tool].",
|
|
108
|
+
relatedControls: ["ITGC-04", "ITGC-01"],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "ITGC-07",
|
|
112
|
+
section: "404",
|
|
113
|
+
title: "IT Operations — Job Scheduling and Processing",
|
|
114
|
+
description: "Controls ensuring batch jobs, interfaces, and automated processes execute completely and accurately.",
|
|
115
|
+
category: "itgc",
|
|
116
|
+
coso: "control_activities",
|
|
117
|
+
type: "detective",
|
|
118
|
+
frequency: "daily",
|
|
119
|
+
assertion: ["completeness", "accuracy", "cutoff"],
|
|
120
|
+
implementation: "Automated job scheduling with monitoring. Job failure alerts and escalation procedures. Reconciliation of batch processing (input vs. output counts). Interface monitoring between systems. Job dependency management. Restart/recovery procedures documented.",
|
|
121
|
+
evidence: ["Job schedule documentation", "Job monitoring dashboard screenshots", "Failure alert configurations", "Batch reconciliation reports", "Interface monitoring logs", "Recovery procedure documentation"],
|
|
122
|
+
commonDeficiencies: ["No monitoring for failed jobs", "Batch reconciliation not performed", "Interface errors not detected timely", "No documented recovery procedures", "Job schedules not reviewed periodically", "Manual interventions not logged"],
|
|
123
|
+
testingApproach: "Review job schedules for financially significant processes. Verify monitoring and alerting configuration. Review failure logs and response times. Test batch reconciliation processes. Verify interface completeness checks.",
|
|
124
|
+
policyTemplate: "[Organization] maintains automated job scheduling and monitoring for all batch processes affecting financial reporting. Job failures trigger alerts to [team] within [N] minutes. Batch processing reconciliation verifies completeness of [key processes] daily. Interface monitoring validates [input/output] for all system integrations. Recovery procedures are documented and tested [frequency].",
|
|
125
|
+
relatedControls: ["ITGC-08", "BP-03"],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "ITGC-08",
|
|
129
|
+
section: "404",
|
|
130
|
+
title: "IT Operations — Backup and Recovery",
|
|
131
|
+
description: "Controls ensuring data and systems supporting financial reporting can be restored in case of failure or disaster.",
|
|
132
|
+
category: "itgc",
|
|
133
|
+
coso: "control_activities",
|
|
134
|
+
type: "corrective",
|
|
135
|
+
frequency: "daily",
|
|
136
|
+
assertion: ["existence", "completeness"],
|
|
137
|
+
implementation: "Automated backups per defined schedule. Off-site/cloud backup storage. Backup encryption. Regular restore testing. Defined RPO/RTO for financial systems. Disaster recovery plan with financial system priority. Annual DR testing.",
|
|
138
|
+
evidence: ["Backup schedule and configuration", "Backup completion logs", "Restore test results", "RPO/RTO documentation", "DR plan with financial system scope", "Annual DR test results", "Backup encryption evidence"],
|
|
139
|
+
commonDeficiencies: ["Backups not tested for restorability", "No defined RPO/RTO", "Backup media stored on-site only", "DR plan doesn't cover all financial systems", "DR test not performed annually", "Backup failures not monitored"],
|
|
140
|
+
testingApproach: "Review backup configuration and completion logs. Verify successful restore tests. Confirm RPO/RTO alignment with business needs. Review DR plan scope and test results. Verify off-site storage and encryption.",
|
|
141
|
+
policyTemplate: "[Organization] maintains comprehensive backup and recovery controls for all systems supporting financial reporting. Backups run [frequency] with [RPO]. Restore tests are performed [frequency] with documented results. Off-site backup storage is maintained at [location/provider]. The Disaster Recovery Plan covers all financially significant systems with [RTO]. DR tests are conducted annually with lessons learned documented.",
|
|
142
|
+
relatedControls: ["ITGC-07"],
|
|
143
|
+
},
|
|
144
|
+
// ── BUSINESS PROCESS CONTROLS ───────────────────────────────────────
|
|
145
|
+
{
|
|
146
|
+
id: "BP-01",
|
|
147
|
+
section: "404",
|
|
148
|
+
title: "Financial Close — Journal Entry Controls",
|
|
149
|
+
description: "Controls over the initiation, review, approval, and posting of journal entries to ensure completeness and accuracy of financial records.",
|
|
150
|
+
category: "business_process",
|
|
151
|
+
coso: "control_activities",
|
|
152
|
+
type: "preventive",
|
|
153
|
+
frequency: "per_transaction",
|
|
154
|
+
assertion: ["completeness", "accuracy", "existence", "cutoff"],
|
|
155
|
+
implementation: "Standard journal entry authorization matrix. Segregation of duties: preparer vs. approver. System-enforced approval workflows. Management review of non-standard/manual entries. Threshold-based review (all entries above materiality). Restricted posting access. Automated reversals flagged.",
|
|
156
|
+
evidence: ["Journal entry policy with authorization matrix", "Sample entries with approval evidence", "Non-standard entry review documentation", "Access control report for posting privileges", "Automated reversal monitoring reports", "Period-end journal entry review sign-off"],
|
|
157
|
+
commonDeficiencies: ["Journal entries posted without approval", "Same person prepares and approves entries", "No review of non-standard/manual entries", "Excessive posting access", "No monitoring of automated reversals", "Back-dated entries not controlled"],
|
|
158
|
+
testingApproach: "Select sample of journal entries (standard, non-standard, manual, automated reversals). Verify authorization per policy. Test SoD for preparation vs. approval. Review management sign-off on non-standard entries. Verify posting access restriction.",
|
|
159
|
+
policyTemplate: "[Organization] requires all journal entries to be authorized per the Journal Entry Authorization Matrix. Standard entries follow automated workflows. Non-standard and manual entries require review by [role] before posting. Entries exceeding [threshold] require [additional approval]. The journal entry preparer cannot approve their own entries. Management reviews all period-end adjusting entries with documented sign-off.",
|
|
160
|
+
relatedControls: ["BP-02", "BP-03", "ITGC-01"],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: "BP-02",
|
|
164
|
+
section: "404",
|
|
165
|
+
title: "Financial Close — Account Reconciliation",
|
|
166
|
+
description: "Timely preparation, review, and approval of balance sheet account reconciliations to ensure accuracy and completeness.",
|
|
167
|
+
category: "business_process",
|
|
168
|
+
coso: "control_activities",
|
|
169
|
+
type: "detective",
|
|
170
|
+
frequency: "monthly",
|
|
171
|
+
assertion: ["existence", "completeness", "valuation", "rights_obligations"],
|
|
172
|
+
implementation: "All balance sheet accounts reconciled per closing calendar. Reconciliation prepared by account owner, reviewed by independent party. Aging of reconciling items tracked. Materiality thresholds for investigation. Reconciliation tool or standardized template. Escalation for overdue reconciliations.",
|
|
173
|
+
evidence: ["Reconciliation policy and calendar", "Completed reconciliations with reviewer sign-off", "Aging reports for reconciling items", "Escalation records for overdue items", "Reconciliation completeness tracker"],
|
|
174
|
+
commonDeficiencies: ["Reconciliations not completed timely", "No independent review of reconciliations", "Stale reconciling items not investigated", "Incomplete reconciliation scope", "Reconciliation sign-off missing", "No tracking of reconciliation completion"],
|
|
175
|
+
testingApproach: "Select sample of balance sheet accounts. Verify reconciliation completion within policy deadlines. Confirm independent review and sign-off. Examine reconciling items for aging and resolution. Verify mathematical accuracy. Test completeness of reconciliation scope.",
|
|
176
|
+
policyTemplate: "[Organization] requires all balance sheet accounts to be reconciled [frequency] within [N] days of period close. Reconciliations are prepared by the account owner and independently reviewed by [role]. Reconciling items exceeding [N] days are escalated to [management level]. The reconciliation tracker is maintained by [role] and reviewed by [Controller/CFO] to ensure 100% completion.",
|
|
177
|
+
relatedControls: ["BP-01", "BP-03"],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: "BP-03",
|
|
181
|
+
section: "404",
|
|
182
|
+
title: "Financial Close — Close Process and Checklist",
|
|
183
|
+
description: "Formal financial close process with defined steps, deadlines, owners, and management review to ensure complete and accurate period-end reporting.",
|
|
184
|
+
category: "business_process",
|
|
185
|
+
coso: "control_activities",
|
|
186
|
+
type: "detective",
|
|
187
|
+
frequency: "monthly",
|
|
188
|
+
assertion: ["completeness", "cutoff", "accuracy"],
|
|
189
|
+
implementation: "Detailed close checklist with task assignments and deadlines. Status tracking and escalation for delays. Management review of close package. Intercompany elimination procedures. Consolidation controls. Sub-certification by business units. Analytics review of financial results.",
|
|
190
|
+
evidence: ["Close checklist with completion evidence", "Close calendar with deadlines", "Management review sign-off on close package", "Sub-certification letters", "Analytical review documentation", "Intercompany elimination reconciliation"],
|
|
191
|
+
commonDeficiencies: ["Close process informal or undocumented", "No tracking of close task completion", "Management review is perfunctory (rubber stamp)", "Intercompany eliminations not reconciled", "No analytical review of results", "Sub-certifications missing or incomplete"],
|
|
192
|
+
testingApproach: "Review close checklists for sampled periods. Verify task completion within deadlines. Review management sign-off and evidence of substantive review. Test intercompany eliminations. Verify analytical review was performed and documented.",
|
|
193
|
+
policyTemplate: "[Organization] maintains a formal financial close process managed through a standardized close checklist. The close calendar defines deadlines for all tasks, with [role] responsible for tracking completion. Management reviews the close package including [key analyses] and provides documented sign-off. Business units provide sub-certifications for their results. Analytical review of financial results is performed by [role] comparing to [budget/prior period/forecast].",
|
|
194
|
+
relatedControls: ["BP-01", "BP-02", "EL-03"],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: "BP-04",
|
|
198
|
+
section: "404",
|
|
199
|
+
title: "Revenue — Revenue Recognition Controls",
|
|
200
|
+
description: "Controls ensuring revenue is recognized in accordance with ASC 606 / IFRS 15 with proper evidence of performance obligations.",
|
|
201
|
+
category: "business_process",
|
|
202
|
+
coso: "control_activities",
|
|
203
|
+
type: "preventive",
|
|
204
|
+
frequency: "per_transaction",
|
|
205
|
+
assertion: ["existence", "completeness", "accuracy", "cutoff", "valuation"],
|
|
206
|
+
implementation: "Revenue recognition policy aligned with ASC 606 five-step model. Contract review for performance obligation identification. System-enforced revenue recognition rules where possible. Manual adjustments reviewed by accounting management. Cutoff testing at period end. Variable consideration estimation review. Bill-and-hold, consignment, and right-of-return procedures.",
|
|
207
|
+
evidence: ["Revenue recognition policy (ASC 606 aligned)", "Contract review documentation", "System configuration for revenue rules", "Manual adjustment review evidence", "Cutoff testing workpapers", "Variable consideration estimation documentation", "Revenue disaggregation analysis"],
|
|
208
|
+
commonDeficiencies: ["Revenue recognition policy not updated for ASC 606", "Performance obligations not properly identified", "Cutoff errors at period end", "Variable consideration not estimated properly", "Bill-and-hold criteria not evaluated", "No review of manual revenue adjustments"],
|
|
209
|
+
testingApproach: "Select sample of revenue transactions across periods. Trace from contract to revenue recognition. Verify performance obligation identification. Test cutoff for transactions near period end. Review variable consideration estimates. Verify ASC 606 disclosure completeness.",
|
|
210
|
+
policyTemplate: "[Organization] recognizes revenue in accordance with ASC 606 using the five-step model: (1) identify contracts, (2) identify performance obligations, (3) determine transaction price, (4) allocate transaction price, (5) recognize revenue when/as performance obligations are satisfied. Contract reviews for complex arrangements are performed by [role]. Variable consideration is estimated using [method] and constrained appropriately. Revenue cutoff procedures are performed at each period end.",
|
|
211
|
+
relatedControls: ["BP-01", "BP-03", "EL-03"],
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: "BP-05",
|
|
215
|
+
section: "404",
|
|
216
|
+
title: "Procure-to-Pay — Vendor Master Controls",
|
|
217
|
+
description: "Controls over creation, modification, and deactivation of vendor master records to prevent unauthorized payments.",
|
|
218
|
+
category: "business_process",
|
|
219
|
+
coso: "control_activities",
|
|
220
|
+
type: "preventive",
|
|
221
|
+
frequency: "per_transaction",
|
|
222
|
+
assertion: ["existence", "rights_obligations", "accuracy"],
|
|
223
|
+
implementation: "Formal vendor onboarding with W-9/tax documentation. Segregation: vendor master changes vs. payment processing. Approval required for new vendors and banking changes. Duplicate vendor detection. Regular vendor master review. Vendor banking change verification (callback, email confirmation). Deactivation of dormant vendors.",
|
|
224
|
+
evidence: ["Vendor onboarding procedures", "Vendor master change approvals", "SoD matrix for vendor master vs. AP", "Duplicate detection reports", "Vendor master review sign-off", "Banking change verification evidence"],
|
|
225
|
+
commonDeficiencies: ["No approval for vendor master changes", "Same person creates vendors and processes payments", "No verification of banking changes (BEC fraud risk)", "Duplicate vendors active", "Dormant vendors not deactivated", "No W-9 on file for 1099 vendors"],
|
|
226
|
+
testingApproach: "Select sample of new vendors and vendor changes. Verify approvals and documentation. Test SoD between vendor master and AP. Review banking change verifications. Run duplicate vendor analysis. Review dormant vendor list.",
|
|
227
|
+
policyTemplate: "[Organization] controls vendor master data through formal procedures. New vendors require [documentation] and approval from [role]. Banking information changes require verification through [callback/confirmation method] before activation. Vendor master changes are segregated from payment processing. Duplicate vendor scans run [frequency]. Vendors inactive for [N] months are deactivated and reviewed before reactivation.",
|
|
228
|
+
relatedControls: ["BP-06", "ITGC-01"],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: "BP-06",
|
|
232
|
+
section: "404",
|
|
233
|
+
title: "Procure-to-Pay — Three-Way Match",
|
|
234
|
+
description: "Automated or manual matching of purchase orders, receiving documents, and invoices before payment to ensure only legitimate obligations are paid.",
|
|
235
|
+
category: "business_process",
|
|
236
|
+
coso: "control_activities",
|
|
237
|
+
type: "preventive",
|
|
238
|
+
frequency: "per_transaction",
|
|
239
|
+
assertion: ["existence", "accuracy", "completeness"],
|
|
240
|
+
implementation: "System-enforced three-way match (PO, receipt, invoice). Tolerance thresholds for auto-match. Exception queue for mismatches with defined resolution procedures. Non-PO invoice approval workflow. Duplicate invoice detection. Payment authorization levels.",
|
|
241
|
+
evidence: ["Three-way match configuration", "Match exception reports and resolutions", "Non-PO invoice approval records", "Duplicate invoice detection reports", "Payment authorization matrix"],
|
|
242
|
+
commonDeficiencies: ["Three-way match bypassed for certain transaction types", "Tolerance thresholds too high", "Match exceptions not resolved timely", "No duplicate invoice detection", "Non-PO invoices approved without scrutiny", "Payment runs not reviewed before release"],
|
|
243
|
+
testingApproach: "Select sample of payments. Verify three-way match evidence. Review exception handling. Test duplicate invoice detection. Verify non-PO invoice approvals. Review payment authorization against policy.",
|
|
244
|
+
policyTemplate: "[Organization] requires three-way matching of purchase orders, receiving documents, and vendor invoices before payment. The system enforces matching with [tolerance %]. Match exceptions are routed to [role] for investigation and resolution within [N] days. Non-PO invoices require approval from [role] above [threshold]. Duplicate invoice detection runs automatically. Payment runs exceeding [threshold] require [additional approval].",
|
|
245
|
+
relatedControls: ["BP-05", "BP-01"],
|
|
246
|
+
},
|
|
247
|
+
// ── ENTITY-LEVEL CONTROLS ──────────────────────────────────────────
|
|
248
|
+
{
|
|
249
|
+
id: "EL-01",
|
|
250
|
+
section: "302",
|
|
251
|
+
title: "Tone at the Top — CEO/CFO Certification",
|
|
252
|
+
description: "CEO and CFO certifications under Section 302 regarding the effectiveness of disclosure controls and procedures.",
|
|
253
|
+
category: "entity_level",
|
|
254
|
+
coso: "control_environment",
|
|
255
|
+
type: "detective",
|
|
256
|
+
frequency: "quarterly",
|
|
257
|
+
assertion: ["completeness", "accuracy", "existence"],
|
|
258
|
+
implementation: "Quarterly Section 302 certifications by CEO and CFO. Sub-certification process from business unit leaders and functional executives. Disclosure committee review of significant items. Evaluation of disclosure controls and procedures effectiveness. Documentation of evaluation basis.",
|
|
259
|
+
evidence: ["Signed 302 certifications", "Sub-certification letters from business units", "Disclosure committee meeting minutes", "Evaluation documentation", "List of significant disclosure items reviewed"],
|
|
260
|
+
commonDeficiencies: ["Sub-certification process not implemented", "Disclosure committee meets infrequently or informally", "No documentation of evaluation methodology", "CEO/CFO sign without substantive review", "Significant items not surfaced to disclosure committee"],
|
|
261
|
+
testingApproach: "Review signed 302 certifications. Verify sub-certification process and coverage. Review disclosure committee meeting minutes for substantive discussion. Verify evaluation documentation supports certification.",
|
|
262
|
+
policyTemplate: "[Organization]'s CEO and CFO provide Section 302 certifications quarterly supported by a sub-certification process. Business unit leaders and functional executives submit sub-certifications covering [scope] by [deadline]. The Disclosure Committee meets [frequency] to review significant items and assess disclosure controls effectiveness. The evaluation methodology is documented and covers [scope].",
|
|
263
|
+
relatedControls: ["EL-02", "EL-03", "BP-03"],
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: "EL-02",
|
|
267
|
+
section: "404",
|
|
268
|
+
title: "Risk Assessment — Financial Reporting Risk",
|
|
269
|
+
description: "Formal process for identifying and assessing risks to financial reporting, including fraud risk, and mapping controls to address those risks.",
|
|
270
|
+
category: "entity_level",
|
|
271
|
+
coso: "risk_assessment",
|
|
272
|
+
type: "detective",
|
|
273
|
+
frequency: "annual",
|
|
274
|
+
assertion: ["completeness", "accuracy", "valuation"],
|
|
275
|
+
implementation: "Annual financial reporting risk assessment. Fraud risk assessment per ASC 240 / SAS 99. Significant account and disclosure identification. Relevant assertion identification for each significant account. Control mapping to risks and assertions. Materiality determination. Scoping of locations and business units.",
|
|
276
|
+
evidence: ["Financial reporting risk assessment", "Fraud risk assessment", "Significant account identification with materiality", "Risk-control mapping matrix", "Scoping documentation", "Materiality calculation"],
|
|
277
|
+
commonDeficiencies: ["No formal risk assessment process", "Fraud risk assessment not performed", "Risk assessment not updated for business changes", "Significant accounts not properly identified", "Controls not mapped to specific risks and assertions", "Materiality not calculated or not appropriate"],
|
|
278
|
+
testingApproach: "Review risk assessment methodology and results. Verify fraud risk assessment completeness. Confirm significant account identification and materiality basis. Verify control-to-risk mapping. Assess whether scoping captures all material locations.",
|
|
279
|
+
policyTemplate: "[Organization] performs an annual financial reporting risk assessment covering fraud risk, significant accounts and disclosures, and control mapping. Materiality is calculated using [methodology]. The risk assessment drives the scoping of locations, business units, and controls for SOX compliance. Fraud risk assessment follows [ASC 240/SAS 99] guidance. The risk-control matrix is maintained by [role] and reviewed by [approver].",
|
|
280
|
+
relatedControls: ["EL-01", "EL-03"],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
id: "EL-03",
|
|
284
|
+
section: "404",
|
|
285
|
+
title: "Monitoring — Management Review Controls",
|
|
286
|
+
description: "Ongoing monitoring activities and management reviews that provide oversight of internal controls over financial reporting.",
|
|
287
|
+
category: "entity_level",
|
|
288
|
+
coso: "monitoring",
|
|
289
|
+
type: "detective",
|
|
290
|
+
frequency: "quarterly",
|
|
291
|
+
assertion: ["completeness", "accuracy", "valuation"],
|
|
292
|
+
implementation: "Quarterly management review of financial results (budget vs. actual, trend analysis, KPIs). Board/audit committee oversight. Internal audit program. Deficiency evaluation process (significant deficiency vs. material weakness). Remediation tracking. Annual control self-assessment.",
|
|
293
|
+
evidence: ["Management review meeting minutes with financial analysis", "Board/audit committee materials and minutes", "Internal audit reports", "Deficiency evaluation documentation", "Remediation tracking reports", "Control self-assessment results"],
|
|
294
|
+
commonDeficiencies: ["Management reviews lack rigor or documentation", "Audit committee not independent or not financial experts", "Internal audit function absent or under-resourced", "Deficiency evaluation process not formalized", "Remediation plans not tracked to completion", "No control self-assessment"],
|
|
295
|
+
testingApproach: "Review management review documentation for evidence of substantive analysis. Verify board/audit committee independence and expertise. Review internal audit charter, plan, and reports. Test deficiency evaluation process for sampled deficiencies. Verify remediation status.",
|
|
296
|
+
policyTemplate: "[Organization] maintains ongoing monitoring of internal controls through: (1) quarterly management reviews of financial results including [analyses performed], (2) audit committee oversight with [frequency] meetings, (3) internal audit program covering [scope], (4) formal deficiency evaluation classifying findings as control deficiency, significant deficiency, or material weakness, (5) remediation tracking with [role] accountability.",
|
|
297
|
+
relatedControls: ["EL-01", "EL-02", "BP-03"],
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: "EL-04",
|
|
301
|
+
section: "301",
|
|
302
|
+
title: "Audit Committee — Independence and Oversight",
|
|
303
|
+
description: "Audit committee composition, independence, financial expertise, and oversight responsibilities under Section 301.",
|
|
304
|
+
category: "entity_level",
|
|
305
|
+
coso: "control_environment",
|
|
306
|
+
type: "preventive",
|
|
307
|
+
frequency: "annual",
|
|
308
|
+
assertion: ["existence", "rights_obligations"],
|
|
309
|
+
implementation: "Audit committee charter defining responsibilities. All members independent directors. At least one financial expert. Direct authority over external auditor. Whistleblower complaint procedures. Regular private sessions with external and internal auditors. Review of related party transactions.",
|
|
310
|
+
evidence: ["Audit committee charter", "Member independence assessments", "Financial expert designation", "Meeting minutes", "Whistleblower procedure documentation", "External auditor engagement letter"],
|
|
311
|
+
commonDeficiencies: ["Committee member not independent", "No designated financial expert", "Charter not updated", "Insufficient meeting frequency", "No private sessions with auditors", "Whistleblower procedures not communicated"],
|
|
312
|
+
testingApproach: "Review audit committee charter and composition. Verify independence of all members. Confirm financial expert designation and qualifications. Review meeting minutes for rigor. Verify whistleblower procedures are operational.",
|
|
313
|
+
policyTemplate: "[Organization]'s Audit Committee consists of [N] independent directors with [name] designated as the financial expert per SEC rules. The Committee meets [frequency], maintains direct authority over the external auditor, and conducts private sessions with external and internal auditors at each meeting. Whistleblower complaints are received through [channel] and reviewed by the Committee per the complaint handling procedures.",
|
|
314
|
+
relatedControls: ["EL-01", "EL-03"],
|
|
315
|
+
},
|
|
316
|
+
// ── DISCLOSURE CONTROLS ────────────────────────────────────────────
|
|
317
|
+
{
|
|
318
|
+
id: "DC-01",
|
|
319
|
+
section: "409",
|
|
320
|
+
title: "Real-Time Disclosure — Material Event Reporting",
|
|
321
|
+
description: "Procedures for identifying and reporting material events on a rapid and current basis through 8-K filings.",
|
|
322
|
+
category: "disclosure",
|
|
323
|
+
coso: "information_communication",
|
|
324
|
+
type: "detective",
|
|
325
|
+
frequency: "continuous",
|
|
326
|
+
assertion: ["completeness", "accuracy", "cutoff"],
|
|
327
|
+
implementation: "Disclosure triggers matrix defining reportable events. Escalation procedures for material events. Disclosure committee rapid-response protocol. 8-K filing procedures within 4 business days. Legal review of disclosure language. Communication channels from business units to legal/finance.",
|
|
328
|
+
evidence: ["Disclosure triggers matrix", "Escalation procedure documentation", "8-K filing log with timing", "Disclosure committee rapid-response records", "Legal review sign-off", "Communication channel documentation"],
|
|
329
|
+
commonDeficiencies: ["No disclosure triggers matrix", "Business units not aware of escalation obligations", "8-K filings late (more than 4 business days)", "No legal review of disclosure language", "Disclosure committee not convened for triggering events", "Incomplete coverage of reportable events"],
|
|
330
|
+
testingApproach: "Review disclosure triggers matrix for completeness against SEC requirements. Test notification and escalation procedures. Verify 8-K filing timeliness for sampled events. Confirm legal review process. Assess communication channels from business units.",
|
|
331
|
+
policyTemplate: "[Organization] maintains real-time disclosure procedures per Section 409. The Disclosure Triggers Matrix defines [N] categories of reportable events. Business units are required to notify [legal/finance] within [N] hours of a potential triggering event. The Disclosure Committee convenes within [N] hours. 8-K filings are prepared, legally reviewed, and filed within 4 business days. The disclosure triggers matrix is reviewed [frequency].",
|
|
332
|
+
relatedControls: ["EL-01", "DC-02"],
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: "DC-02",
|
|
336
|
+
section: "802",
|
|
337
|
+
title: "Record Retention — Document Preservation",
|
|
338
|
+
description: "Controls ensuring retention of audit workpapers, financial records, and electronic communications per SOX Section 802.",
|
|
339
|
+
category: "disclosure",
|
|
340
|
+
coso: "information_communication",
|
|
341
|
+
type: "preventive",
|
|
342
|
+
frequency: "continuous",
|
|
343
|
+
assertion: ["existence", "completeness"],
|
|
344
|
+
implementation: "Document retention policy covering SOX requirements (7-year minimum for audit workpapers). Electronic communication preservation. Litigation hold procedures. Document destruction schedule with compliance checkpoints. Audit workpaper protection and access controls. Training on retention obligations.",
|
|
345
|
+
evidence: ["Document retention policy", "Retention schedule by document type", "Litigation hold procedures", "Electronic communication archiving system", "Audit workpaper access controls", "Training records"],
|
|
346
|
+
commonDeficiencies: ["No formal retention policy", "Audit workpapers destroyed prematurely", "No litigation hold procedures", "Electronic communications not preserved", "Retention policy not communicated to employees", "Auto-deletion policies conflict with retention requirements"],
|
|
347
|
+
testingApproach: "Review retention policy against SOX requirements. Verify electronic communication archiving. Test litigation hold procedures. Verify audit workpaper retention and access controls. Confirm retention schedule compliance for sampled document types.",
|
|
348
|
+
policyTemplate: "[Organization] maintains document retention controls per SOX Section 802. Audit workpapers and supporting documents are retained for [7+] years. Electronic communications are archived using [system]. Litigation holds are managed by [legal] with preservation notices to [scope]. Document destruction follows the approved retention schedule with compliance review before execution.",
|
|
349
|
+
relatedControls: ["DC-01", "EL-04"],
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
id: "DC-03",
|
|
353
|
+
section: "806",
|
|
354
|
+
title: "Whistleblower Protection",
|
|
355
|
+
description: "Procedures for receiving, retaining, and responding to complaints regarding accounting, internal controls, or auditing matters, with whistleblower protection.",
|
|
356
|
+
category: "disclosure",
|
|
357
|
+
coso: "control_environment",
|
|
358
|
+
type: "detective",
|
|
359
|
+
frequency: "continuous",
|
|
360
|
+
assertion: ["completeness", "existence"],
|
|
361
|
+
implementation: "Anonymous reporting channels (hotline, web portal, email). Complaints routed to audit committee. Investigation procedures. Protection against retaliation. Record retention for complaints. Regular reporting to audit committee. Third-party hotline provider recommended.",
|
|
362
|
+
evidence: ["Whistleblower policy", "Hotline/reporting channel configuration", "Complaint log and investigation records", "Audit committee complaint reports", "Anti-retaliation policy", "Training records on whistleblower procedures"],
|
|
363
|
+
commonDeficiencies: ["No anonymous reporting channel", "Complaints not routed to audit committee", "Investigation procedures informal", "No anti-retaliation protections documented", "Employees unaware of reporting channels", "Complaint log not maintained"],
|
|
364
|
+
testingApproach: "Review whistleblower policy and reporting channels. Verify anonymity capability. Confirm routing to audit committee. Review investigation procedures for sampled complaints. Verify anti-retaliation policy communication.",
|
|
365
|
+
policyTemplate: "[Organization] maintains confidential whistleblower reporting channels including [hotline number, web portal URL, email]. Reports are received by [third-party provider] and routed to the Audit Committee. Investigations follow documented procedures managed by [role]. Anti-retaliation protections are communicated to all employees during [onboarding/annual training]. Complaint activity is reported to the Audit Committee [frequency].",
|
|
366
|
+
relatedControls: ["EL-04", "DC-01"],
|
|
367
|
+
},
|
|
368
|
+
];
|
|
369
|
+
// ── Readiness Assessment ──────────────────────────────────────────────
|
|
370
|
+
function assessReadiness(implementedControls) {
|
|
371
|
+
const implemented = new Set(implementedControls.map((c) => c.toUpperCase()));
|
|
372
|
+
const total = SOX_CONTROLS.length;
|
|
373
|
+
let totalImplemented = 0;
|
|
374
|
+
const byCategory = {};
|
|
375
|
+
for (const control of SOX_CONTROLS) {
|
|
376
|
+
const cat = control.category;
|
|
377
|
+
if (!byCategory[cat])
|
|
378
|
+
byCategory[cat] = { implemented: 0, total: 0, score: 0 };
|
|
379
|
+
byCategory[cat].total++;
|
|
380
|
+
if (implemented.has(control.id)) {
|
|
381
|
+
totalImplemented++;
|
|
382
|
+
byCategory[cat].implemented++;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
for (const cat of Object.keys(byCategory)) {
|
|
386
|
+
byCategory[cat].score = Math.round((byCategory[cat].implemented / byCategory[cat].total) * 100);
|
|
387
|
+
}
|
|
388
|
+
const score = Math.round((totalImplemented / total) * 100);
|
|
389
|
+
const criticalGaps = SOX_CONTROLS.filter((c) => !implemented.has(c.id) && (c.section === "404" || c.section === "302"));
|
|
390
|
+
const recommendations = [];
|
|
391
|
+
if (!implemented.has("EL-02"))
|
|
392
|
+
recommendations.push("IMMEDIATE: Perform financial reporting risk assessment — this drives all other SOX compliance activities");
|
|
393
|
+
if (!implemented.has("ITGC-01"))
|
|
394
|
+
recommendations.push("CRITICAL: Implement formal access management — auditors test this in every engagement");
|
|
395
|
+
if (!implemented.has("ITGC-04"))
|
|
396
|
+
recommendations.push("CRITICAL: Formalize change management — uncontrolled changes are a common material weakness");
|
|
397
|
+
if (!implemented.has("BP-01"))
|
|
398
|
+
recommendations.push("HIGH: Implement journal entry controls — most common area for fraud and material misstatement");
|
|
399
|
+
if (!implemented.has("BP-02"))
|
|
400
|
+
recommendations.push("HIGH: Implement account reconciliation process — detective control for catching errors");
|
|
401
|
+
if (!implemented.has("EL-01"))
|
|
402
|
+
recommendations.push("REQUIRED: Establish Section 302 certification and sub-certification process");
|
|
403
|
+
if (!implemented.has("EL-04"))
|
|
404
|
+
recommendations.push("REQUIRED: Ensure audit committee independence and financial expertise per Section 301");
|
|
405
|
+
if (byCategory["itgc"]?.score < 50)
|
|
406
|
+
recommendations.push("ITGC are the foundation — auditors can't rely on automated controls if ITGCs fail");
|
|
407
|
+
if (recommendations.length === 0)
|
|
408
|
+
recommendations.push("Strong posture — focus on testing effectiveness and documentation quality");
|
|
409
|
+
return { score, total, implemented: totalImplemented, byCategory, criticalGaps, recommendations };
|
|
410
|
+
}
|
|
411
|
+
// ── MCP Server ────────────────────────────────────────────────────────
|
|
412
|
+
const server = new McpServer({
|
|
413
|
+
name: "sox-compliance-mcp",
|
|
414
|
+
version: "0.1.0",
|
|
415
|
+
});
|
|
416
|
+
// Tool 1: Browse Controls
|
|
417
|
+
server.tool("browse_controls", "Browse SOX control requirements by section (302/404/906/etc.), category (itgc/business_process/entity_level/disclosure), COSO component, or control type.", {
|
|
418
|
+
section: z.enum(["302", "404", "906", "409", "802", "806", "301"]).optional().describe("Filter by SOX section"),
|
|
419
|
+
category: z.enum(["itgc", "business_process", "entity_level", "it_dependent_manual", "disclosure"]).optional().describe("Filter by control category"),
|
|
420
|
+
coso: z.enum(["control_environment", "risk_assessment", "control_activities", "information_communication", "monitoring"]).optional().describe("Filter by COSO component"),
|
|
421
|
+
type: z.enum(["preventive", "detective", "corrective"]).optional().describe("Filter by control type"),
|
|
422
|
+
search: z.string().optional().describe("Search control titles and descriptions"),
|
|
423
|
+
}, async ({ section, category, coso, type, search }) => {
|
|
424
|
+
let results = [...SOX_CONTROLS];
|
|
425
|
+
if (section)
|
|
426
|
+
results = results.filter((c) => c.section === section);
|
|
427
|
+
if (category)
|
|
428
|
+
results = results.filter((c) => c.category === category);
|
|
429
|
+
if (coso)
|
|
430
|
+
results = results.filter((c) => c.coso === coso);
|
|
431
|
+
if (type)
|
|
432
|
+
results = results.filter((c) => c.type === type);
|
|
433
|
+
if (search) {
|
|
434
|
+
const q = search.toLowerCase();
|
|
435
|
+
results = results.filter((c) => c.title.toLowerCase().includes(q) || c.description.toLowerCase().includes(q) || c.id.toLowerCase().includes(q));
|
|
436
|
+
}
|
|
437
|
+
if (results.length === 0) {
|
|
438
|
+
return { content: [{ type: "text", text: "No controls match your criteria." }] };
|
|
439
|
+
}
|
|
440
|
+
const output = [
|
|
441
|
+
`# SOX Controls (${results.length} results)`,
|
|
442
|
+
``,
|
|
443
|
+
...results.map((c) => [
|
|
444
|
+
`## ${c.id}: ${c.title}`,
|
|
445
|
+
`**Section:** ${c.section} | **Category:** ${c.category} | **COSO:** ${c.coso} | **Type:** ${c.type} | **Frequency:** ${c.frequency}`,
|
|
446
|
+
`**Assertions:** ${c.assertion.join(", ")}`,
|
|
447
|
+
``,
|
|
448
|
+
c.description,
|
|
449
|
+
``,
|
|
450
|
+
`**Implementation:** ${c.implementation}`,
|
|
451
|
+
``,
|
|
452
|
+
`**Common Deficiencies:**`,
|
|
453
|
+
...c.commonDeficiencies.map((d) => `- ${d}`),
|
|
454
|
+
``,
|
|
455
|
+
`**Testing Approach:** ${c.testingApproach}`,
|
|
456
|
+
``,
|
|
457
|
+
].join("\n")),
|
|
458
|
+
`---`,
|
|
459
|
+
`Automate your SOX compliance: https://complianceiq.site`,
|
|
460
|
+
].join("\n");
|
|
461
|
+
return { content: [{ type: "text", text: output }] };
|
|
462
|
+
});
|
|
463
|
+
// Tool 2: Assess Readiness
|
|
464
|
+
server.tool("assess_readiness", "Score your SOX compliance readiness based on which controls you've implemented. Provide the IDs of controls you have in place.", {
|
|
465
|
+
implementedControls: z.array(z.string()).describe("Array of control IDs you have implemented (e.g., ['ITGC-01', 'BP-01', 'EL-01'])"),
|
|
466
|
+
companyType: z.enum(["large_accelerated_filer", "accelerated_filer", "non_accelerated_filer", "emerging_growth"]).default("accelerated_filer").describe("SEC filer category — affects SOX requirements"),
|
|
467
|
+
}, async ({ implementedControls, companyType }) => {
|
|
468
|
+
const result = assessReadiness(implementedControls);
|
|
469
|
+
const filerNote = companyType === "emerging_growth"
|
|
470
|
+
? "\n**Note:** As an Emerging Growth Company, Section 404(b) external auditor attestation is not required (but 404(a) management assessment is)."
|
|
471
|
+
: companyType === "non_accelerated_filer"
|
|
472
|
+
? "\n**Note:** Non-Accelerated Filers are exempt from Section 404(b) external auditor attestation."
|
|
473
|
+
: "";
|
|
474
|
+
const output = [
|
|
475
|
+
`# SOX Compliance Readiness Assessment`,
|
|
476
|
+
``,
|
|
477
|
+
`## Overall Score: ${result.score}%`,
|
|
478
|
+
`- **Controls Implemented:** ${result.implemented}/${result.total}`,
|
|
479
|
+
`- **Filer Category:** ${companyType.replace(/_/g, " ")}${filerNote}`,
|
|
480
|
+
``,
|
|
481
|
+
`## Readiness by Category`,
|
|
482
|
+
...Object.entries(result.byCategory)
|
|
483
|
+
.filter(([, v]) => v.total > 0)
|
|
484
|
+
.map(([cat, v]) => `- **${cat.replace(/_/g, " ")}:** ${v.implemented}/${v.total} (${v.score}%) ${v.score < 50 ? "-- CRITICAL GAP" : v.score < 80 ? "-- needs attention" : "-- good"}`),
|
|
485
|
+
``,
|
|
486
|
+
`## Section 404/302 Controls Missing (${result.criticalGaps.length})`,
|
|
487
|
+
...result.criticalGaps.map((g) => `- **${g.id}:** ${g.title} (Section ${g.section})`),
|
|
488
|
+
``,
|
|
489
|
+
`## Priority Recommendations`,
|
|
490
|
+
...result.recommendations.map((r, i) => `${i + 1}. ${r}`),
|
|
491
|
+
``,
|
|
492
|
+
`## Audit Readiness`,
|
|
493
|
+
result.score >= 80 ? "**READY** — Strong control environment. Focus on testing documentation and operating effectiveness evidence." :
|
|
494
|
+
result.score >= 50 ? "**AT RISK** — Significant gaps may result in significant deficiencies or material weaknesses. Remediate before audit period." :
|
|
495
|
+
"**NOT READY** — Major control gaps exist. Material weakness likely if audited. Prioritize ITGC and entity-level controls immediately.",
|
|
496
|
+
``,
|
|
497
|
+
`---`,
|
|
498
|
+
`Track your SOX compliance: https://complianceiq.site`,
|
|
499
|
+
].join("\n");
|
|
500
|
+
return { content: [{ type: "text", text: output }] };
|
|
501
|
+
});
|
|
502
|
+
// Tool 3: Generate Policy
|
|
503
|
+
server.tool("generate_policy", "Generate a SOX-compliant policy document for a specific control. Includes implementation requirements, evidence needed, and common deficiencies to avoid.", {
|
|
504
|
+
controlId: z.string().describe("Control ID to generate policy for (e.g., 'ITGC-01', 'BP-01', 'EL-01')"),
|
|
505
|
+
companyName: z.string().default("[Organization]").describe("Company name for the policy document"),
|
|
506
|
+
}, async ({ controlId, companyName }) => {
|
|
507
|
+
const control = SOX_CONTROLS.find((c) => c.id === controlId.toUpperCase());
|
|
508
|
+
if (!control) {
|
|
509
|
+
return { content: [{ type: "text", text: `Control ${controlId} not found. Use browse_controls to see available IDs.` }] };
|
|
510
|
+
}
|
|
511
|
+
const output = [
|
|
512
|
+
`# ${companyName} — ${control.title} Policy`,
|
|
513
|
+
`**Control ID:** ${control.id} | **SOX Section:** ${control.section} | **Category:** ${control.category}`,
|
|
514
|
+
`**COSO Component:** ${control.coso} | **Type:** ${control.type} | **Frequency:** ${control.frequency}`,
|
|
515
|
+
``,
|
|
516
|
+
`## 1. Purpose`,
|
|
517
|
+
control.description,
|
|
518
|
+
``,
|
|
519
|
+
`## 2. Scope`,
|
|
520
|
+
`This policy applies to all financially significant systems, processes, and personnel involved in ${control.title.toLowerCase()}.`,
|
|
521
|
+
``,
|
|
522
|
+
`## 3. Policy Statement`,
|
|
523
|
+
control.policyTemplate.replace(/\[Organization\]/g, companyName),
|
|
524
|
+
``,
|
|
525
|
+
`## 4. Implementation Requirements`,
|
|
526
|
+
control.implementation,
|
|
527
|
+
``,
|
|
528
|
+
`## 5. Assertions Addressed`,
|
|
529
|
+
...control.assertion.map((a) => `- **${a.replace(/_/g, " ")}**`),
|
|
530
|
+
``,
|
|
531
|
+
`## 6. Evidence Requirements`,
|
|
532
|
+
...control.evidence.map((e, i) => `${i + 1}. ${e}`),
|
|
533
|
+
``,
|
|
534
|
+
`## 7. Testing Approach`,
|
|
535
|
+
control.testingApproach,
|
|
536
|
+
``,
|
|
537
|
+
`## 8. Common Deficiencies to Avoid`,
|
|
538
|
+
...control.commonDeficiencies.map((d) => `- ${d}`),
|
|
539
|
+
``,
|
|
540
|
+
`## 9. Related Controls`,
|
|
541
|
+
...control.relatedControls.map((id) => {
|
|
542
|
+
const related = SOX_CONTROLS.find((c) => c.id === id);
|
|
543
|
+
return related ? `- **${id}:** ${related.title}` : `- ${id}`;
|
|
544
|
+
}),
|
|
545
|
+
``,
|
|
546
|
+
`## 10. Review and Approval`,
|
|
547
|
+
`| Role | Name | Date | Signature |`,
|
|
548
|
+
`|------|------|------|-----------|`,
|
|
549
|
+
`| Policy Owner | | | |`,
|
|
550
|
+
`| SOX Program Manager | | | |`,
|
|
551
|
+
`| CFO / Controller | | | |`,
|
|
552
|
+
``,
|
|
553
|
+
`**Effective Date:** ___________`,
|
|
554
|
+
`**Next Review:** ___________`,
|
|
555
|
+
`**Version:** 1.0`,
|
|
556
|
+
``,
|
|
557
|
+
`---`,
|
|
558
|
+
`Automate SOX policy generation: https://complianceiq.site`,
|
|
559
|
+
].join("\n");
|
|
560
|
+
return { content: [{ type: "text", text: output }] };
|
|
561
|
+
});
|
|
562
|
+
// Tool 4: Evidence Checklist
|
|
563
|
+
server.tool("evidence_checklist", "Generate a comprehensive evidence collection checklist for SOX audit readiness, either for a specific control or an entire category.", {
|
|
564
|
+
controlId: z.string().optional().describe("Specific control ID (e.g., 'ITGC-01'). If omitted, generates checklist for the entire category."),
|
|
565
|
+
category: z.enum(["itgc", "business_process", "entity_level", "disclosure"]).optional().describe("Category to generate checklist for (used when controlId is omitted)"),
|
|
566
|
+
format: z.enum(["checklist", "walkthrough", "testing_matrix"]).default("checklist").describe("Output format"),
|
|
567
|
+
}, async ({ controlId, category, format }) => {
|
|
568
|
+
let controls;
|
|
569
|
+
let title;
|
|
570
|
+
if (controlId) {
|
|
571
|
+
const control = SOX_CONTROLS.find((c) => c.id === controlId.toUpperCase());
|
|
572
|
+
if (!control) {
|
|
573
|
+
return { content: [{ type: "text", text: `Control ${controlId} not found.` }] };
|
|
574
|
+
}
|
|
575
|
+
controls = [control];
|
|
576
|
+
title = `${control.id}: ${control.title}`;
|
|
577
|
+
}
|
|
578
|
+
else if (category) {
|
|
579
|
+
controls = SOX_CONTROLS.filter((c) => c.category === category);
|
|
580
|
+
title = `${category.replace(/_/g, " ").toUpperCase()} Controls`;
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
controls = SOX_CONTROLS;
|
|
584
|
+
title = "All SOX Controls";
|
|
585
|
+
}
|
|
586
|
+
let output;
|
|
587
|
+
if (format === "walkthrough") {
|
|
588
|
+
output = [
|
|
589
|
+
`# SOX Walkthrough Template: ${title}`,
|
|
590
|
+
``,
|
|
591
|
+
...controls.map((c) => [
|
|
592
|
+
`## ${c.id}: ${c.title}`,
|
|
593
|
+
`**Section:** ${c.section} | **Frequency:** ${c.frequency} | **Type:** ${c.type}`,
|
|
594
|
+
``,
|
|
595
|
+
`### Process Description`,
|
|
596
|
+
c.implementation,
|
|
597
|
+
``,
|
|
598
|
+
`### Walkthrough Questions`,
|
|
599
|
+
`1. Who performs this control? (Name, title, department)`,
|
|
600
|
+
`2. How frequently is it performed?`,
|
|
601
|
+
`3. What triggers the control execution?`,
|
|
602
|
+
`4. What is reviewed/checked during execution?`,
|
|
603
|
+
`5. What evidence is generated?`,
|
|
604
|
+
`6. Where is evidence stored?`,
|
|
605
|
+
`7. What happens when an exception is identified?`,
|
|
606
|
+
`8. Who reviews the control performer's work?`,
|
|
607
|
+
``,
|
|
608
|
+
`### Evidence Observed During Walkthrough`,
|
|
609
|
+
...c.evidence.map((e) => `- [ ] ${e}`),
|
|
610
|
+
``,
|
|
611
|
+
`### Walkthrough Conclusion`,
|
|
612
|
+
`- [ ] Control is designed effectively`,
|
|
613
|
+
`- [ ] Control is operating as designed`,
|
|
614
|
+
`- [ ] Exception/deficiency identified: ___________`,
|
|
615
|
+
``,
|
|
616
|
+
].join("\n")),
|
|
617
|
+
`---`,
|
|
618
|
+
`Streamline SOX walkthroughs: https://complianceiq.site`,
|
|
619
|
+
].join("\n");
|
|
620
|
+
}
|
|
621
|
+
else if (format === "testing_matrix") {
|
|
622
|
+
output = [
|
|
623
|
+
`# SOX Testing Matrix: ${title}`,
|
|
624
|
+
``,
|
|
625
|
+
`| Control ID | Control Title | Type | Frequency | Sample Size | Test Procedure | Result | Exception |`,
|
|
626
|
+
`|-----------|--------------|------|-----------|-------------|---------------|--------|-----------|`,
|
|
627
|
+
...controls.map((c) => {
|
|
628
|
+
const sampleSize = c.frequency === "annual" ? "1" : c.frequency === "quarterly" ? "2-4" : c.frequency === "monthly" ? "2-5" : c.frequency === "daily" ? "25-40" : "25-60";
|
|
629
|
+
return `| ${c.id} | ${c.title} | ${c.type} | ${c.frequency} | ${sampleSize} | ${c.testingApproach.slice(0, 80)}... | [ ] Pass [ ] Fail | |`;
|
|
630
|
+
}),
|
|
631
|
+
``,
|
|
632
|
+
`## Sample Size Guidance (PCAOB AS 2201)`,
|
|
633
|
+
`- **Annual controls:** 1 instance`,
|
|
634
|
+
`- **Quarterly controls:** 2-4 instances`,
|
|
635
|
+
`- **Monthly controls:** 2-5 instances`,
|
|
636
|
+
`- **Weekly controls:** 5-15 instances`,
|
|
637
|
+
`- **Daily/per-transaction controls:** 25-60 instances (based on risk)`,
|
|
638
|
+
``,
|
|
639
|
+
`---`,
|
|
640
|
+
`Automate SOX testing: https://complianceiq.site`,
|
|
641
|
+
].join("\n");
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
output = [
|
|
645
|
+
`# SOX Evidence Checklist: ${title}`,
|
|
646
|
+
``,
|
|
647
|
+
...controls.map((c) => [
|
|
648
|
+
`## ${c.id}: ${c.title}`,
|
|
649
|
+
`**Section:** ${c.section} | **Category:** ${c.category} | **Frequency:** ${c.frequency}`,
|
|
650
|
+
``,
|
|
651
|
+
...c.evidence.map((e) => `- [ ] ${e}`),
|
|
652
|
+
``,
|
|
653
|
+
`**Deadline:** ___________`,
|
|
654
|
+
`**Owner:** ___________`,
|
|
655
|
+
`**Status:** Not Started / In Progress / Complete`,
|
|
656
|
+
``,
|
|
657
|
+
].join("\n")),
|
|
658
|
+
`---`,
|
|
659
|
+
`Track SOX evidence collection: https://complianceiq.site`,
|
|
660
|
+
].join("\n");
|
|
661
|
+
}
|
|
662
|
+
return { content: [{ type: "text", text: output }] };
|
|
663
|
+
});
|
|
664
|
+
// Tool 5: Gap Analysis
|
|
665
|
+
server.tool("gap_analysis", "Compare your current SOX controls against requirements and identify gaps with prioritized remediation recommendations.", {
|
|
666
|
+
implementedControls: z.array(z.string()).describe("Array of control IDs you have implemented"),
|
|
667
|
+
auditTimeline: z.enum(["under_3_months", "3_to_6_months", "6_to_12_months", "over_12_months"]).default("6_to_12_months").describe("Time until SOX audit/assessment"),
|
|
668
|
+
firstYearSOX: z.boolean().default(false).describe("Is this the company's first year of SOX compliance (e.g., post-IPO)?"),
|
|
669
|
+
}, async ({ implementedControls, auditTimeline, firstYearSOX }) => {
|
|
670
|
+
const implemented = new Set(implementedControls.map((c) => c.toUpperCase()));
|
|
671
|
+
const gaps = SOX_CONTROLS.filter((c) => !implemented.has(c.id));
|
|
672
|
+
const urgencyMap = {
|
|
673
|
+
under_3_months: 4,
|
|
674
|
+
"3_to_6_months": 3,
|
|
675
|
+
"6_to_12_months": 2,
|
|
676
|
+
over_12_months: 1,
|
|
677
|
+
};
|
|
678
|
+
const urgency = urgencyMap[auditTimeline] || 2;
|
|
679
|
+
const prioritized = gaps.map((g) => {
|
|
680
|
+
let priority = 0;
|
|
681
|
+
if (g.section === "404")
|
|
682
|
+
priority += 3;
|
|
683
|
+
if (g.section === "302")
|
|
684
|
+
priority += 3;
|
|
685
|
+
if (g.category === "itgc")
|
|
686
|
+
priority += 2;
|
|
687
|
+
if (g.category === "entity_level")
|
|
688
|
+
priority += 2;
|
|
689
|
+
if (g.type === "preventive")
|
|
690
|
+
priority += 1;
|
|
691
|
+
return { ...g, priority };
|
|
692
|
+
}).sort((a, b) => b.priority - a.priority);
|
|
693
|
+
const firstYearNote = firstYearSOX
|
|
694
|
+
? `\n**First-Year SOX Note:** Focus on design effectiveness first. Operating effectiveness testing requires controls to be in place for a sufficient period (typically 2-3 quarters minimum for key controls). Prioritize ITGC and entity-level controls as the foundation.\n`
|
|
695
|
+
: "";
|
|
696
|
+
const output = [
|
|
697
|
+
`# SOX Gap Analysis`,
|
|
698
|
+
``,
|
|
699
|
+
`## Summary`,
|
|
700
|
+
`- **Controls Implemented:** ${implementedControls.length}/${SOX_CONTROLS.length}`,
|
|
701
|
+
`- **Gaps Identified:** ${gaps.length}`,
|
|
702
|
+
`- **Time to Audit:** ${auditTimeline.replace(/_/g, " ")}`,
|
|
703
|
+
`- **Urgency Level:** ${urgency >= 3 ? "HIGH" : urgency >= 2 ? "MEDIUM" : "LOW"}`,
|
|
704
|
+
firstYearNote,
|
|
705
|
+
`## Prioritized Gaps (Highest Priority First)`,
|
|
706
|
+
``,
|
|
707
|
+
...prioritized.map((g, i) => [
|
|
708
|
+
`### ${i + 1}. ${g.id}: ${g.title}`,
|
|
709
|
+
`**Section:** ${g.section} | **Category:** ${g.category} | **Priority Score:** ${g.priority}/8`,
|
|
710
|
+
``,
|
|
711
|
+
g.description,
|
|
712
|
+
``,
|
|
713
|
+
`**To Implement:**`,
|
|
714
|
+
g.implementation,
|
|
715
|
+
``,
|
|
716
|
+
`**Evidence Needed:**`,
|
|
717
|
+
...g.evidence.map((e) => `- ${e}`),
|
|
718
|
+
``,
|
|
719
|
+
`**Risk if Not Addressed:**`,
|
|
720
|
+
...g.commonDeficiencies.slice(0, 3).map((d) => `- ${d}`),
|
|
721
|
+
``,
|
|
722
|
+
].join("\n")),
|
|
723
|
+
`## Remediation Timeline`,
|
|
724
|
+
urgency >= 3
|
|
725
|
+
? `**URGENT:** With audit in <6 months, prioritize top 5 gaps immediately. Consider engaging a SOX consulting firm for rapid remediation.`
|
|
726
|
+
: urgency >= 2
|
|
727
|
+
? `**Manageable:** Implement 2-3 controls per month. Start with ITGC and entity-level controls.`
|
|
728
|
+
: `**Comfortable:** Build the program methodically. Start with risk assessment (EL-02) to drive scoping decisions.`,
|
|
729
|
+
``,
|
|
730
|
+
`---`,
|
|
731
|
+
`Automate your SOX gap analysis: https://complianceiq.site`,
|
|
732
|
+
].join("\n");
|
|
733
|
+
return { content: [{ type: "text", text: output }] };
|
|
734
|
+
});
|
|
735
|
+
// Tool 6: Material Weakness Evaluator
|
|
736
|
+
server.tool("evaluate_deficiency", "Evaluate whether a control deficiency constitutes a significant deficiency or material weakness using the PCAOB AS 2201 framework.", {
|
|
737
|
+
deficiencyDescription: z.string().describe("Description of the control deficiency"),
|
|
738
|
+
controlId: z.string().optional().describe("Related control ID if applicable"),
|
|
739
|
+
financialStatementImpact: z.enum(["material", "more_than_inconsequential", "inconsequential"]).describe("Potential magnitude of financial statement impact"),
|
|
740
|
+
likelihoodOfOccurrence: z.enum(["reasonably_possible", "remote", "probable"]).describe("Likelihood that the deficiency could result in a misstatement"),
|
|
741
|
+
compensatingControls: z.boolean().default(false).describe("Are there compensating controls that mitigate the deficiency?"),
|
|
742
|
+
}, async ({ deficiencyDescription, controlId, financialStatementImpact, likelihoodOfOccurrence, compensatingControls }) => {
|
|
743
|
+
const control = controlId ? SOX_CONTROLS.find((c) => c.id === controlId.toUpperCase()) : null;
|
|
744
|
+
let classification;
|
|
745
|
+
let explanation;
|
|
746
|
+
if (financialStatementImpact === "material" && likelihoodOfOccurrence === "probable") {
|
|
747
|
+
classification = "MATERIAL WEAKNESS";
|
|
748
|
+
explanation = "A material misstatement is probable. This must be reported in management's assessment and will result in an adverse opinion on ICFR from the auditor.";
|
|
749
|
+
}
|
|
750
|
+
else if (financialStatementImpact === "material" && likelihoodOfOccurrence === "reasonably_possible") {
|
|
751
|
+
classification = compensatingControls ? "SIGNIFICANT DEFICIENCY (with compensating controls)" : "MATERIAL WEAKNESS";
|
|
752
|
+
explanation = compensatingControls
|
|
753
|
+
? "The potential for material misstatement exists but compensating controls reduce likelihood. Document compensating controls thoroughly — auditor may still disagree."
|
|
754
|
+
: "A material misstatement is more than remote. Per PCAOB AS 2201, a reasonable possibility of material misstatement = material weakness.";
|
|
755
|
+
}
|
|
756
|
+
else if (financialStatementImpact === "more_than_inconsequential") {
|
|
757
|
+
classification = compensatingControls ? "CONTROL DEFICIENCY" : "SIGNIFICANT DEFICIENCY";
|
|
758
|
+
explanation = compensatingControls
|
|
759
|
+
? "Impact exceeds inconsequential but compensating controls provide coverage. Document and monitor closely."
|
|
760
|
+
: "Severity exceeds a control deficiency but doesn't rise to material weakness. Still must be communicated to audit committee.";
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
classification = "CONTROL DEFICIENCY";
|
|
764
|
+
explanation = "Impact is inconsequential and/or occurrence is remote. Document and include in management's tracking but doesn't require disclosure.";
|
|
765
|
+
}
|
|
766
|
+
const output = [
|
|
767
|
+
`# Deficiency Evaluation`,
|
|
768
|
+
``,
|
|
769
|
+
`## Classification: ${classification}`,
|
|
770
|
+
``,
|
|
771
|
+
`## Deficiency Description`,
|
|
772
|
+
deficiencyDescription,
|
|
773
|
+
control ? `\n**Related Control:** ${control.id} — ${control.title} (Section ${control.section})` : "",
|
|
774
|
+
``,
|
|
775
|
+
`## Evaluation Factors`,
|
|
776
|
+
`- **Financial Statement Impact:** ${financialStatementImpact.replace(/_/g, " ")}`,
|
|
777
|
+
`- **Likelihood of Occurrence:** ${likelihoodOfOccurrence.replace(/_/g, " ")}`,
|
|
778
|
+
`- **Compensating Controls:** ${compensatingControls ? "Yes" : "No"}`,
|
|
779
|
+
``,
|
|
780
|
+
`## Analysis`,
|
|
781
|
+
explanation,
|
|
782
|
+
``,
|
|
783
|
+
`## Required Actions by Classification`,
|
|
784
|
+
classification.includes("MATERIAL WEAKNESS") ? [
|
|
785
|
+
`### Material Weakness Requirements`,
|
|
786
|
+
`1. Disclose in management's Section 404 assessment`,
|
|
787
|
+
`2. Cannot conclude ICFR is effective`,
|
|
788
|
+
`3. Auditor will issue adverse opinion on ICFR`,
|
|
789
|
+
`4. Must remediate — most companies target remediation before next annual assessment`,
|
|
790
|
+
`5. SEC may increase scrutiny of future filings`,
|
|
791
|
+
`6. Consider impact on Section 302 certifications`,
|
|
792
|
+
`7. Board/audit committee notification required`,
|
|
793
|
+
].join("\n") : classification.includes("SIGNIFICANT") ? [
|
|
794
|
+
`### Significant Deficiency Requirements`,
|
|
795
|
+
`1. Communicate in writing to audit committee`,
|
|
796
|
+
`2. Include in management's deficiency tracking`,
|
|
797
|
+
`3. Develop remediation plan with timeline`,
|
|
798
|
+
`4. Monitor for aggregation with other deficiencies (could aggregate to MW)`,
|
|
799
|
+
`5. External auditor will include in their communication to audit committee`,
|
|
800
|
+
].join("\n") : [
|
|
801
|
+
`### Control Deficiency Requirements`,
|
|
802
|
+
`1. Document in management's deficiency log`,
|
|
803
|
+
`2. Include in periodic control monitoring`,
|
|
804
|
+
`3. Remediate per normal course`,
|
|
805
|
+
`4. Monitor for recurrence or aggregation`,
|
|
806
|
+
].join("\n"),
|
|
807
|
+
``,
|
|
808
|
+
`## PCAOB AS 2201 Framework Reference`,
|
|
809
|
+
`Per PCAOB Auditing Standard 2201:`,
|
|
810
|
+
`- **Material Weakness:** Reasonable possibility that material misstatement won't be prevented/detected timely`,
|
|
811
|
+
`- **Significant Deficiency:** Less severe than MW but important enough to merit audit committee attention`,
|
|
812
|
+
`- **Control Deficiency:** Design or operation doesn't allow prevention/detection of misstatements timely`,
|
|
813
|
+
``,
|
|
814
|
+
`*Note: Multiple control deficiencies can aggregate to a significant deficiency or material weakness.*`,
|
|
815
|
+
``,
|
|
816
|
+
`---`,
|
|
817
|
+
`Track deficiency remediation: https://complianceiq.site`,
|
|
818
|
+
].join("\n");
|
|
819
|
+
return { content: [{ type: "text", text: output }] };
|
|
820
|
+
});
|
|
821
|
+
// ── Start Server ──────────────────────────────────────────────────────
|
|
822
|
+
async function main() {
|
|
823
|
+
const transport = new StdioServerTransport();
|
|
824
|
+
await server.connect(transport);
|
|
825
|
+
}
|
|
826
|
+
main().catch((error) => {
|
|
827
|
+
console.error("Server error:", error);
|
|
828
|
+
process.exit(1);
|
|
829
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sox-compliance-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Sarbanes-Oxley (SOX) compliance — browse control requirements, assess readiness, generate ITGC/business process control templates, evidence checklists, and gap analysis for public companies",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"sox-compliance-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"start": "node dist/index.js",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"mcp",
|
|
21
|
+
"model-context-protocol",
|
|
22
|
+
"sox",
|
|
23
|
+
"sarbanes-oxley",
|
|
24
|
+
"compliance",
|
|
25
|
+
"itgc",
|
|
26
|
+
"internal-controls",
|
|
27
|
+
"financial-reporting",
|
|
28
|
+
"section-302",
|
|
29
|
+
"section-404",
|
|
30
|
+
"coso",
|
|
31
|
+
"pcaob",
|
|
32
|
+
"audit",
|
|
33
|
+
"risk-assessment",
|
|
34
|
+
"material-weakness",
|
|
35
|
+
"significant-deficiency",
|
|
36
|
+
"control-testing",
|
|
37
|
+
"walkthrough",
|
|
38
|
+
"segregation-of-duties",
|
|
39
|
+
"change-management",
|
|
40
|
+
"access-controls",
|
|
41
|
+
"regtech",
|
|
42
|
+
"complianceiq"
|
|
43
|
+
],
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
46
|
+
"zod": "^3.24.4"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^25.8.0",
|
|
50
|
+
"typescript": "^5.8.3"
|
|
51
|
+
}
|
|
52
|
+
}
|