@sakk-dev/sakk 0.0.0-stage → 0.4.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/package.json CHANGED
@@ -1,6 +1,90 @@
1
1
  {
2
2
  "name": "@sakk-dev/sakk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "The original check, rebuilt for AI agents — a fail-closed spend ledger: reserve before you spawn, settle with real costs, refuse everything pathological.",
5
+ "type": "module",
6
+ "main": "src/ledger.mjs",
7
+ "exports": {
8
+ ".": "./src/ledger.mjs",
9
+ "./policy": "./src/policy.mjs"
10
+ },
11
+ "bin": {
12
+ "sakk": "bin/sakk.mjs"
13
+ },
14
+ "scripts": {
15
+ "test": "node --import ./test/clean-git-env.mjs --test --import ./test/bounded-spawn.mjs --test-timeout=300000 test/*.test.mjs",
16
+ "test:eval": "node eval/bin/gold-runner.mjs --validate && node --import ./test/clean-git-env.mjs --test --import ./test/bounded-spawn.mjs --test-timeout=300000 eval/__tests__/*.test.mjs",
17
+ "test:all": "npm test && npm run test:eval",
18
+ "drill": "sh scripts/mutation-drill.sh",
19
+ "format": "npx -y prettier@3.9.10 --write .",
20
+ "format:check": "npx -y prettier@3.9.10 --check .",
21
+ "lint": "npx -y eslint@10.13.0 --max-warnings=0 .",
22
+ "gate": "bash scripts/gate.sh",
23
+ "fuzz": "node scripts/invariant-fuzz.mjs",
24
+ "fuzz:policy": "node scripts/policy-fuzz.mjs",
25
+ "fuzz:l1": "node scripts/l1-fuzz.mjs",
26
+ "brief": "node scripts/findings-brief.mjs",
27
+ "hooks": "node scripts/hooks/install.mjs",
28
+ "findings:check": "node scripts/findings-check.mjs",
29
+ "inbox": "node scripts/findings-inbox.mjs",
30
+ "campaigns": "node scripts/campaign/fault-injection.mjs && node scripts/campaign/soak-ledger.mjs --minutes 0.2 --workers 4 && node scripts/campaign/mcp-torture.mjs --minutes 0.25 --servers 2",
31
+ "certificate": "node scripts/gate-certificate.mjs",
32
+ "evidence": "node scripts/evidence-bundle.mjs",
33
+ "audit": "node scripts/audit.mjs",
34
+ "golden-k": "node scripts/golden-k.mjs",
35
+ "attack-asr": "node scripts/attack-asr.mjs",
36
+ "findings-report": "node scripts/findings-report.mjs"
37
+ },
38
+ "engines": {
39
+ "node": ">=20"
40
+ },
41
+ "os": [
42
+ "darwin",
43
+ "linux"
44
+ ],
45
+ "keywords": [
46
+ "ai-agents",
47
+ "budget",
48
+ "spend-gate",
49
+ "ledger",
50
+ "fail-closed",
51
+ "governance",
52
+ "llm",
53
+ "agent-ops",
54
+ "claude-code",
55
+ "claude-code-plugin",
56
+ "ai-agent-security",
57
+ "guardrails",
58
+ "spend-cap",
59
+ "kill-switch",
60
+ "secret-scanning",
61
+ "mcp",
62
+ "litellm",
63
+ "openai-compatible",
64
+ "llm-gateway"
65
+ ],
66
+ "author": "The Sakk authors",
67
+ "license": "Apache-2.0",
68
+ "repository": {
69
+ "type": "git",
70
+ "url": "git+https://github.com/sakk-dev/sakk.git"
71
+ },
72
+ "bugs": {
73
+ "url": "https://github.com/sakk-dev/sakk/issues"
74
+ },
75
+ "homepage": "https://github.com/sakk-dev/sakk#readme",
76
+ "files": [
77
+ "src",
78
+ "bin",
79
+ "policies",
80
+ "prices",
81
+ ".claude-plugin",
82
+ "integrations/litellm/sakk_gateway.py",
83
+ "integrations/litellm/config.example.yaml",
84
+ "integrations/litellm/README.md",
85
+ "README.md",
86
+ "CHANGELOG.md",
87
+ "LICENSE",
88
+ "NOTICE"
89
+ ]
90
+ }
@@ -0,0 +1,161 @@
1
+ {
2
+ "schema": "sakk-policy.v1",
3
+ "default_verdict": "deny",
4
+ "rules": [
5
+ {
6
+ "id": "protect-secret-files",
7
+ "match": {
8
+ "action": "secret.read"
9
+ },
10
+ "verdict": "deny"
11
+ },
12
+ {
13
+ "id": "shell-destructive",
14
+ "match": {
15
+ "action": "git.destructive"
16
+ },
17
+ "verdict": "deny"
18
+ },
19
+ {
20
+ "id": "deny-prod-delete",
21
+ "match": {
22
+ "action": "prod.delete"
23
+ },
24
+ "verdict": "deny"
25
+ },
26
+ {
27
+ "id": "deny-delete-protected",
28
+ "match": {
29
+ "action": "file.delete",
30
+ "scope": ["~protected/"]
31
+ },
32
+ "verdict": "deny"
33
+ },
34
+ {
35
+ "id": "allow-temp-cleanup",
36
+ "match": {
37
+ "action": "file.delete",
38
+ "scope": [
39
+ "~outside/tmp/",
40
+ "~outside/private/tmp/",
41
+ "~outside/var/folders/",
42
+ "~outside/private/var/folders/"
43
+ ]
44
+ },
45
+ "verdict": "allow"
46
+ },
47
+ {
48
+ "id": "deny-rm-outside-repo",
49
+ "match": {
50
+ "action": "file.delete",
51
+ "scope": ["~outside/", "~home/"]
52
+ },
53
+ "verdict": "deny"
54
+ },
55
+ {
56
+ "id": "protect-guard-state",
57
+ "match": {
58
+ "action": "file.write",
59
+ "scope": [".sakk/", "~sakk/"]
60
+ },
61
+ "verdict": "deny"
62
+ },
63
+ {
64
+ "id": "protect-guard-state-delete",
65
+ "match": {
66
+ "action": "file.delete",
67
+ "scope": [".sakk/", "~sakk/"]
68
+ },
69
+ "verdict": "deny"
70
+ },
71
+ {
72
+ "id": "protect-ci-files",
73
+ "match": {
74
+ "action": "file.write",
75
+ "scope": [".github/workflows/"]
76
+ },
77
+ "verdict": "deny"
78
+ },
79
+ {
80
+ "id": "protect-migrations",
81
+ "match": {
82
+ "action": "file.delete",
83
+ "scope": ["migrations/", "db/migrations/"]
84
+ },
85
+ "verdict": "deny"
86
+ },
87
+ {
88
+ "id": "deny-agent-config",
89
+ "match": {
90
+ "action": "file.write",
91
+ "scope": [
92
+ ".claude/",
93
+ ".cursor/",
94
+ ".codex/",
95
+ "~home/.claude/",
96
+ "~home/.cursor/",
97
+ "~home/.codex/"
98
+ ]
99
+ },
100
+ "verdict": "deny"
101
+ },
102
+ {
103
+ "id": "deny-agent-config-delete",
104
+ "match": {
105
+ "action": "file.delete",
106
+ "scope": [
107
+ ".claude/",
108
+ ".cursor/",
109
+ ".codex/",
110
+ "~home/.claude/",
111
+ "~home/.cursor/",
112
+ "~home/.codex/"
113
+ ]
114
+ },
115
+ "verdict": "deny"
116
+ },
117
+ {
118
+ "id": "high-risk-deploy",
119
+ "match": {
120
+ "action": "deploy"
121
+ },
122
+ "verdict": "require_approval",
123
+ "approvers_min": 1
124
+ },
125
+ {
126
+ "id": "ask-constructed-commands",
127
+ "match": {
128
+ "action": "shell.constructed"
129
+ },
130
+ "verdict": "require_approval",
131
+ "approvers_min": 1
132
+ },
133
+ {
134
+ "id": "allow-temp-write",
135
+ "match": {
136
+ "action": "file.write",
137
+ "scope": [
138
+ "~outside/tmp/",
139
+ "~outside/private/tmp/",
140
+ "~outside/var/folders/",
141
+ "~outside/private/var/folders/"
142
+ ]
143
+ },
144
+ "verdict": "allow"
145
+ },
146
+ {
147
+ "id": "ask-write-outside",
148
+ "match": {
149
+ "action": "file.write",
150
+ "scope": ["~outside/", "~home/"]
151
+ },
152
+ "verdict": "require_approval",
153
+ "approvers_min": 1
154
+ },
155
+ {
156
+ "id": "allow-in-repo",
157
+ "match": {},
158
+ "verdict": "allow"
159
+ }
160
+ ]
161
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "schema": "sakk-policy.v1",
3
+ "default_verdict": "allow",
4
+ "rules": [
5
+ {
6
+ "id": "no-prod-deploys",
7
+ "match": { "action": "deploy", "scope": ["prod/"] },
8
+ "verdict": "deny"
9
+ },
10
+ {
11
+ "id": "small-spend-auto",
12
+ "match": { "max_estimated_usd": 2 },
13
+ "verdict": "allow"
14
+ },
15
+ {
16
+ "id": "expensive-call-needs-eyes",
17
+ "match": {},
18
+ "verdict": "require_approval",
19
+ "approvers_min": 1
20
+ }
21
+ ]
22
+ }