@datacules/agent-identity-compliance 0.9.0 → 0.11.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 +34 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="../../../assets/logo.svg" alt="Agent Identity — by Datacules LLC" width="360"/>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# `@datacules/agent-identity-compliance`
|
|
2
6
|
|
|
3
7
|
Compliance report generation + tamper-evident audit log for [`@datacules/agent-identity`](../../core).
|
|
4
8
|
|
|
5
9
|
Answers regulatory audit questions directly from your audit logs — no custom queries.
|
|
6
|
-
Provides a SHA-256 hash chain logger and CLI verifier for SOC
|
|
10
|
+
Provides a SHA-256 hash chain logger and CLI verifier for SOC 2, GDPR, and HIPAA evidence.
|
|
7
11
|
|
|
8
12
|
## Install
|
|
9
13
|
|
|
@@ -15,11 +19,11 @@ npm install @datacules/agent-identity-compliance
|
|
|
15
19
|
|
|
16
20
|
| Feature | Description |
|
|
17
21
|
|---------|-------------|
|
|
18
|
-
| `ComplianceReportGenerator` | Generate SOC
|
|
22
|
+
| `ComplianceReportGenerator` | Generate SOC 2 / GDPR / HIPAA reports from audit logs |
|
|
19
23
|
| `HashChainAuditLogger` | Wraps any audit sink — appends SHA-256 chain fields to every entry |
|
|
20
24
|
| `ChainVerifier` | Replays the chain and returns intact/broken status |
|
|
21
|
-
|
|
|
22
|
-
| CLI
|
|
25
|
+
| `MemoryReportStore` | In-memory `ReportStore` for tests and demos |
|
|
26
|
+
| CLI via `@datacules/agent-identity-cli` | `audit verify` and `report` commands for offline use |
|
|
23
27
|
|
|
24
28
|
---
|
|
25
29
|
|
|
@@ -35,18 +39,18 @@ const generator = new ComplianceReportGenerator({
|
|
|
35
39
|
businessHoursEnd: 18,
|
|
36
40
|
});
|
|
37
41
|
|
|
38
|
-
// SOC
|
|
42
|
+
// SOC 2 CC6 — Logical and Physical Access Controls
|
|
39
43
|
const report = await generator.generate({
|
|
40
44
|
type: 'soc2',
|
|
41
45
|
from: '2026-01-01T00:00:00Z',
|
|
42
|
-
to:
|
|
46
|
+
to: '2026-03-31T23:59:59Z',
|
|
43
47
|
});
|
|
44
48
|
|
|
45
49
|
// GDPR Article 30 — Records of Processing Activities (Markdown output)
|
|
46
50
|
const gdprReport = await generator.generate({
|
|
47
51
|
type: 'gdpr',
|
|
48
52
|
from: '2026-01-01T00:00:00Z',
|
|
49
|
-
to:
|
|
53
|
+
to: '2026-03-31T23:59:59Z',
|
|
50
54
|
format: 'markdown',
|
|
51
55
|
});
|
|
52
56
|
|
|
@@ -111,23 +115,27 @@ import { readFileSync } from 'node:fs';
|
|
|
111
115
|
const jsonl = readFileSync('./audit.jsonl', 'utf8');
|
|
112
116
|
const result = ChainVerifier.verifyJsonl(jsonl);
|
|
113
117
|
|
|
114
|
-
console.log(result.intact);
|
|
115
|
-
console.log(result.entryCount);
|
|
116
|
-
console.log(result.rootHash);
|
|
117
|
-
console.log(result.brokenAt);
|
|
118
|
+
console.log(result.intact); // true / false
|
|
119
|
+
console.log(result.entryCount); // number of entries verified
|
|
120
|
+
console.log(result.rootHash); // SHA-256 of the last entry (publish to an anchor)
|
|
121
|
+
console.log(result.brokenAt); // entry index of first broken link (null if intact)
|
|
118
122
|
console.log(result.brokenReason); // human-readable reason (null if intact)
|
|
119
123
|
```
|
|
120
124
|
|
|
121
125
|
---
|
|
122
126
|
|
|
123
|
-
## CLI
|
|
127
|
+
## CLI (via `@datacules/agent-identity-cli`)
|
|
128
|
+
|
|
129
|
+
Install the CLI package for offline log verification and report generation:
|
|
124
130
|
|
|
125
|
-
|
|
131
|
+
```bash
|
|
132
|
+
npm install -g @datacules/agent-identity-cli
|
|
133
|
+
```
|
|
126
134
|
|
|
127
135
|
### Verify an audit log
|
|
128
136
|
|
|
129
137
|
```bash
|
|
130
|
-
agent-identity audit verify --file ./audit.jsonl
|
|
138
|
+
agent-identity-cli audit verify --file ./audit.jsonl
|
|
131
139
|
```
|
|
132
140
|
|
|
133
141
|
Output:
|
|
@@ -148,24 +156,24 @@ Reason : Entry 1204: hash mismatch — entry data appears to have been
|
|
|
148
156
|
Exit code 0 = intact, exit code 1 = broken or empty. Suitable for CI gates:
|
|
149
157
|
|
|
150
158
|
```bash
|
|
151
|
-
agent-identity audit verify --file ./audit.jsonl || { echo "Audit log tampered!"; exit 1; }
|
|
159
|
+
agent-identity-cli audit verify --file ./audit.jsonl || { echo "Audit log tampered!"; exit 1; }
|
|
152
160
|
```
|
|
153
161
|
|
|
154
162
|
### Generate a compliance report
|
|
155
163
|
|
|
156
164
|
```bash
|
|
157
|
-
# SOC
|
|
158
|
-
agent-identity report soc2 --file ./audit.jsonl
|
|
165
|
+
# SOC 2 CC6 — JSON output (default)
|
|
166
|
+
agent-identity-cli report soc2 --file ./audit.jsonl
|
|
159
167
|
|
|
160
168
|
# GDPR Article 30 — Markdown, filtered to Q1 2026
|
|
161
|
-
agent-identity report gdpr
|
|
162
|
-
--file ./audit.jsonl
|
|
163
|
-
--from 2026-01-01
|
|
164
|
-
--to 2026-03-31
|
|
169
|
+
agent-identity-cli report gdpr \\
|
|
170
|
+
--file ./audit.jsonl \\
|
|
171
|
+
--from 2026-01-01 \\
|
|
172
|
+
--to 2026-03-31 \\
|
|
165
173
|
--format markdown
|
|
166
174
|
|
|
167
175
|
# HIPAA §164.312 — save to file
|
|
168
|
-
agent-identity report hipaa --file ./audit.jsonl > ./reports/hipaa-q2.json
|
|
176
|
+
agent-identity-cli report hipaa --file ./audit.jsonl > ./reports/hipaa-q2.json
|
|
169
177
|
```
|
|
170
178
|
|
|
171
179
|
---
|
|
@@ -186,3 +194,7 @@ class PostgresReportStore implements ReportStore {
|
|
|
186
194
|
|
|
187
195
|
const generator = new ComplianceReportGenerator({ store: new PostgresReportStore() });
|
|
188
196
|
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
Part of the [agent-identity monorepo](https://github.com/hvrcharon1/agent-identity) by [Datacules LLC](https://datacules.com).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datacules/agent-identity-compliance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Compliance report generator + tamper-evident audit log for @datacules/agent-identity — SOC 2, GDPR, HIPAA reports, SHA-256 chain verification CLI",
|
|
6
6
|
"author": "Datacules LLC",
|