@asterpay/attest-sdk 0.1.0 → 0.1.1
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 +159 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Attest — EU AI Act compliance in one SDK
|
|
2
|
+
|
|
3
|
+
**Powered by [AsterPay](https://asterpay.io)** — trust & settlement for AI commerce.
|
|
4
|
+
|
|
5
|
+
Attest helps EU teams **discover AI usage in code**, **classify risk heuristically**, **generate Annex IV-style documentation scaffolds**, and **keep tamper-evident audit logs** for AI inferences.
|
|
6
|
+
|
|
7
|
+
> **Not legal advice.** Attest is a developer tool. Always involve qualified counsel for conformity assessment and regulatory obligations.
|
|
8
|
+
|
|
9
|
+
## Try it now (zero install)
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cd your-project
|
|
13
|
+
npx @asterpay/attest scan
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
That's it. Attest scans your TypeScript/JavaScript source for AI SDK imports (OpenAI, Anthropic, Google AI, LangChain, etc.) and reports what it finds:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
📦 Scanned 42 files in ./src
|
|
20
|
+
|
|
21
|
+
src/chat/agent.ts
|
|
22
|
+
→ openai (line 1) ai-sdk
|
|
23
|
+
→ @anthropic-ai/sdk (line 2)
|
|
24
|
+
|
|
25
|
+
src/scoring/classifier.ts
|
|
26
|
+
→ langchain (line 3) ai-sdk
|
|
27
|
+
|
|
28
|
+
🔍 3 AI-related imports found across 2 files
|
|
29
|
+
⚠️ Risk classification: HIGH (Annex III keywords detected)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g @asterpay/attest
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Quick start
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cd your-project
|
|
42
|
+
|
|
43
|
+
# 1) See which AI SDKs your code imports (AST scan)
|
|
44
|
+
attest scan
|
|
45
|
+
|
|
46
|
+
# 2) Heuristic checks: transparency / logging / oversight signals
|
|
47
|
+
attest check
|
|
48
|
+
|
|
49
|
+
# 3) Generate Annex IV–style Markdown scaffolds (fill with counsel)
|
|
50
|
+
attest docs -o ./compliance
|
|
51
|
+
|
|
52
|
+
# 4) Local static dashboard (countdown + CLI hints)
|
|
53
|
+
attest dashboard
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### What each command does
|
|
57
|
+
|
|
58
|
+
| Step | Command | What you get |
|
|
59
|
+
|------|---------|-------------|
|
|
60
|
+
| **Scan** | `attest scan` | List of every AI SDK import in your codebase, file by file |
|
|
61
|
+
| **Check** | `attest check` | Compliance signals: do you have logging? transparency disclosures? human oversight patterns? |
|
|
62
|
+
| **Docs** | `attest docs -o ./compliance` | Three Markdown files: `technical-documentation.md`, `risk-assessment.md`, `conformity-declaration.md` — pre-filled scaffolds for Annex IV, ready for your legal team |
|
|
63
|
+
| **Dashboard** | `attest dashboard` | Local web UI with EU AI Act deadline countdown + quick links |
|
|
64
|
+
|
|
65
|
+
## Packages
|
|
66
|
+
|
|
67
|
+
| Package | npm | Description |
|
|
68
|
+
|---------|-----|-------------|
|
|
69
|
+
| `@asterpay/attest` | [](https://www.npmjs.com/package/@asterpay/attest) | CLI (`attest`) + re-exports SDK |
|
|
70
|
+
| `@asterpay/attest-sdk` | [](https://www.npmjs.com/package/@asterpay/attest-sdk) | Programmatic API |
|
|
71
|
+
|
|
72
|
+
### CLI reference
|
|
73
|
+
|
|
74
|
+
| Command | Purpose |
|
|
75
|
+
|--------|---------|
|
|
76
|
+
| `attest scan [-r DIR]` | List AI-related package imports per file |
|
|
77
|
+
| `attest check [-r DIR]` | Compliance **signals** (not legal sign-off) |
|
|
78
|
+
| `attest docs -o DIR [-r DIR] [--name] [--provider]` | Write `technical-documentation.md`, `risk-assessment.md`, `conformity-declaration.md` |
|
|
79
|
+
| `attest export [--from ISO]` | Dump audit log JSON (needs prior `Attest.track()` usage) |
|
|
80
|
+
| `attest verify [-r DIR]` | Verify audit JSONL hash chain; exits `1` if broken |
|
|
81
|
+
| `attest dashboard [-p PORT]` | Serve local dashboard |
|
|
82
|
+
|
|
83
|
+
Project metadata for `attest docs` (optional): `.attest/config.json` — see below.
|
|
84
|
+
|
|
85
|
+
Optional project metadata (for `attest docs`):
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
// .attest/config.json
|
|
89
|
+
{
|
|
90
|
+
"system": {
|
|
91
|
+
"name": "Customer Support Bot",
|
|
92
|
+
"provider": "Your Company Ltd",
|
|
93
|
+
"description": "Tier-1 support assistant"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Programmatic usage
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { Attest } from '@asterpay/attest';
|
|
102
|
+
|
|
103
|
+
const attest = new Attest({
|
|
104
|
+
system: {
|
|
105
|
+
name: 'My AI feature',
|
|
106
|
+
provider: 'My Org',
|
|
107
|
+
},
|
|
108
|
+
projectRoot: process.cwd(),
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const risk = await attest.classifyRisk();
|
|
112
|
+
const report = attest.check();
|
|
113
|
+
|
|
114
|
+
await attest.track(
|
|
115
|
+
async () => {
|
|
116
|
+
/* your OpenAI / Anthropic call */
|
|
117
|
+
return { ok: true };
|
|
118
|
+
},
|
|
119
|
+
{ purpose: 'support', humanOversight: 'available', containsPII: false },
|
|
120
|
+
);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Monorepo layout
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
attest/
|
|
127
|
+
packages/
|
|
128
|
+
sdk/ @asterpay/attest-sdk
|
|
129
|
+
cli/ @asterpay/attest
|
|
130
|
+
landing/ marketing site (static)
|
|
131
|
+
docs/ publishing, domains, cloud roadmap
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Why?
|
|
135
|
+
|
|
136
|
+
The EU AI Act (Regulation 2024/1689) requires companies deploying AI in the EU to document, classify, and audit their AI systems. The **August 2, 2026** deadline for high-risk systems is approaching fast.
|
|
137
|
+
|
|
138
|
+
Attest doesn't replace legal counsel — it gives your engineering team a head start:
|
|
139
|
+
|
|
140
|
+
- **Discovery** — "Which of our 200 microservices actually use AI SDKs?"
|
|
141
|
+
- **Risk signal** — "Does our code have the logging/oversight patterns regulators expect?"
|
|
142
|
+
- **Documentation** — "Give us Annex IV scaffolds so legal doesn't start from a blank page"
|
|
143
|
+
- **Audit trail** — "Every AI inference is logged with SHA-256 hash chaining"
|
|
144
|
+
|
|
145
|
+
## Contributing
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
git clone https://github.com/AsterPay/attest
|
|
149
|
+
cd attest
|
|
150
|
+
npm install
|
|
151
|
+
npm run build
|
|
152
|
+
npm test
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
See [docs/GITHUB_SETUP.md](docs/GITHUB_SETUP.md) and [docs/PUBLISH.md](docs/PUBLISH.md) for setup and publishing details.
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT © AsterPay contributors
|
package/package.json
CHANGED