@sponsio/sdk 0.1.0-alpha.3 → 0.2.0-alpha.10
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/bin/sponsio.cjs +11 -0
- package/contracts/benchmark/agentdojo.yaml +551 -0
- package/contracts/benchmark/odcv_bench.yaml +393 -0
- package/contracts/benchmark/redcode_exec.yaml +488 -0
- package/contracts/benchmark/swebench.yaml +176 -0
- package/contracts/benchmark/tau2_bench.yaml +984 -0
- package/contracts/capability/credentials.yaml +8 -8
- package/contracts/capability/database.yaml +6 -6
- package/contracts/capability/destructive.yaml +213 -0
- package/contracts/capability/factual-claims.yaml +79 -0
- package/contracts/capability/filesystem-strict.yaml +4 -4
- package/contracts/capability/filesystem.yaml +9 -9
- package/contracts/capability/host-config-integrity.yaml +318 -0
- package/contracts/capability/self-modify.yaml +260 -9
- package/contracts/capability/shell.yaml +43 -41
- package/contracts/capability/subagent.yaml +5 -5
- package/contracts/incident/claude-code-secret-bypass.yaml +57 -26
- package/contracts/incident/cursor-railway-wipe.yaml +63 -7
- package/contracts/incident/mcp-composition.yaml +12 -12
- package/contracts/incident/openclaw.yaml +47 -92
- package/contracts/incident/subagent-escape.yaml +4 -4
- package/contracts/premium/.gitkeep +5 -6
- package/dist/cli/check.d.ts +2 -0
- package/dist/cli/check.d.ts.map +1 -0
- package/dist/cli/check.js +283 -0
- package/dist/cli/check.js.map +1 -0
- package/dist/cli/cli.d.ts +25 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +491 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/config.d.ts +88 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +243 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/demo.d.ts +12 -0
- package/dist/cli/demo.d.ts.map +1 -0
- package/dist/cli/demo.js +350 -0
- package/dist/cli/demo.js.map +1 -0
- package/dist/cli/doctor.d.ts +11 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +201 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/eval.d.ts +2 -0
- package/dist/cli/eval.d.ts.map +1 -0
- package/dist/cli/eval.js +361 -0
- package/dist/cli/eval.js.map +1 -0
- package/dist/cli/explain.d.ts +2 -0
- package/dist/cli/explain.d.ts.map +1 -0
- package/dist/cli/explain.js +266 -0
- package/dist/cli/explain.js.map +1 -0
- package/dist/cli/export-sessions.d.ts +2 -0
- package/dist/cli/export-sessions.d.ts.map +1 -0
- package/dist/cli/export-sessions.js +182 -0
- package/dist/cli/export-sessions.js.map +1 -0
- package/dist/cli/export.d.ts +2 -0
- package/dist/cli/export.d.ts.map +1 -0
- package/dist/cli/export.js +222 -0
- package/dist/cli/export.js.map +1 -0
- package/dist/cli/extractors/common.d.ts +27 -0
- package/dist/cli/extractors/common.d.ts.map +1 -0
- package/dist/cli/extractors/common.js +107 -0
- package/dist/cli/extractors/common.js.map +1 -0
- package/dist/cli/extractors/generic.d.ts +37 -0
- package/dist/cli/extractors/generic.d.ts.map +1 -0
- package/dist/cli/extractors/generic.js +185 -0
- package/dist/cli/extractors/generic.js.map +1 -0
- package/dist/cli/extractors/langchain.d.ts +18 -0
- package/dist/cli/extractors/langchain.d.ts.map +1 -0
- package/dist/cli/extractors/langchain.js +86 -0
- package/dist/cli/extractors/langchain.js.map +1 -0
- package/dist/cli/extractors/vercel.d.ts +17 -0
- package/dist/cli/extractors/vercel.d.ts.map +1 -0
- package/dist/cli/extractors/vercel.js +46 -0
- package/dist/cli/extractors/vercel.js.map +1 -0
- package/dist/cli/index.d.ts +38 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +146 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +177 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/mode.d.ts +2 -0
- package/dist/cli/mode.d.ts.map +1 -0
- package/dist/cli/mode.js +71 -0
- package/dist/cli/mode.js.map +1 -0
- package/dist/cli/onboard.d.ts +88 -0
- package/dist/cli/onboard.d.ts.map +1 -0
- package/dist/cli/onboard.js +758 -0
- package/dist/cli/onboard.js.map +1 -0
- package/dist/cli/otlp.d.ts +27 -0
- package/dist/cli/otlp.d.ts.map +1 -0
- package/dist/cli/otlp.js +79 -0
- package/dist/cli/otlp.js.map +1 -0
- package/dist/cli/package.json +1 -0
- package/dist/cli/packs.d.ts +16 -0
- package/dist/cli/packs.d.ts.map +1 -0
- package/dist/cli/packs.js +190 -0
- package/dist/cli/packs.js.map +1 -0
- package/dist/cli/patterns.d.ts +16 -0
- package/dist/cli/patterns.d.ts.map +1 -0
- package/dist/cli/patterns.js +136 -0
- package/dist/cli/patterns.js.map +1 -0
- package/dist/cli/prompt.d.ts +2 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +54 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/replay.d.ts +2 -0
- package/dist/cli/replay.d.ts.map +1 -0
- package/dist/cli/replay.js +196 -0
- package/dist/cli/replay.js.map +1 -0
- package/dist/cli/report.d.ts +57 -0
- package/dist/cli/report.d.ts.map +1 -0
- package/dist/cli/report.js +298 -0
- package/dist/cli/report.js.map +1 -0
- package/dist/cli/scan.d.ts +2 -0
- package/dist/cli/scan.d.ts.map +1 -0
- package/dist/cli/scan.js +172 -0
- package/dist/cli/scan.js.map +1 -0
- package/dist/cli/skill.d.ts +15 -0
- package/dist/cli/skill.d.ts.map +1 -0
- package/dist/cli/skill.js +131 -0
- package/dist/cli/skill.js.map +1 -0
- package/dist/cli/tokens.d.ts +31 -0
- package/dist/cli/tokens.d.ts.map +1 -0
- package/dist/cli/tokens.js +73 -0
- package/dist/cli/tokens.js.map +1 -0
- package/dist/cli/types.d.ts +46 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +3 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/validate.d.ts +19 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +205 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/cli/zod.d.ts +36 -0
- package/dist/cli/zod.d.ts.map +1 -0
- package/dist/cli/zod.js +226 -0
- package/dist/cli/zod.js.map +1 -0
- package/dist/cloud/client.d.ts +76 -0
- package/dist/cloud/client.d.ts.map +1 -0
- package/dist/cloud/client.js +204 -0
- package/dist/cloud/client.js.map +1 -0
- package/dist/cloud/evidence.d.ts +108 -0
- package/dist/cloud/evidence.d.ts.map +1 -0
- package/dist/cloud/evidence.js +184 -0
- package/dist/cloud/evidence.js.map +1 -0
- package/dist/cloud/privacy.d.ts +67 -0
- package/dist/cloud/privacy.d.ts.map +1 -0
- package/dist/cloud/privacy.js +170 -0
- package/dist/cloud/privacy.js.map +1 -0
- package/dist/cloud/view-model.d.ts +49 -0
- package/dist/cloud/view-model.d.ts.map +1 -0
- package/dist/cloud/view-model.js +172 -0
- package/dist/cloud/view-model.js.map +1 -0
- package/dist/contract.d.ts +13 -13
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +21 -21
- package/dist/contract.js.map +1 -1
- package/dist/core/config-loader.d.ts +1 -1
- package/dist/core/config-loader.d.ts.map +1 -1
- package/dist/core/config-loader.js +116 -26
- package/dist/core/config-loader.js.map +1 -1
- package/dist/core/evaluator.d.ts +11 -1
- package/dist/core/evaluator.d.ts.map +1 -1
- package/dist/core/evaluator.js +275 -13
- package/dist/core/evaluator.js.map +1 -1
- package/dist/core/formula.d.ts +76 -17
- package/dist/core/formula.d.ts.map +1 -1
- package/dist/core/formula.js +95 -1
- package/dist/core/formula.js.map +1 -1
- package/dist/core/grounding.d.ts +86 -3
- package/dist/core/grounding.d.ts.map +1 -1
- package/dist/core/grounding.js +485 -143
- package/dist/core/grounding.js.map +1 -1
- package/dist/core/nl-parser.d.ts +2 -2
- package/dist/core/nl-parser.d.ts.map +1 -1
- package/dist/core/nl-parser.js +690 -42
- package/dist/core/nl-parser.js.map +1 -1
- package/dist/core/pack-loader.d.ts.map +1 -1
- package/dist/core/pack-loader.js +14 -2
- package/dist/core/pack-loader.js.map +1 -1
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/parser.js +30 -1
- package/dist/core/parser.js.map +1 -1
- package/dist/core/pattern-factory.d.ts +4 -4
- package/dist/core/pattern-factory.d.ts.map +1 -1
- package/dist/core/pattern-factory.js +59 -4
- package/dist/core/pattern-factory.js.map +1 -1
- package/dist/core/patterns.d.ts +196 -5
- package/dist/core/patterns.d.ts.map +1 -1
- package/dist/core/patterns.js +400 -13
- package/dist/core/patterns.js.map +1 -1
- package/dist/core/session-log.d.ts.map +1 -1
- package/dist/core/session-log.js +20 -1
- package/dist/core/session-log.js.map +1 -1
- package/dist/core/spans.d.ts +1 -1
- package/dist/core/spans.d.ts.map +1 -1
- package/dist/core/spans.js.map +1 -1
- package/dist/core/sto.d.ts +30 -66
- package/dist/core/sto.d.ts.map +1 -1
- package/dist/core/sto.js +39 -100
- package/dist/core/sto.js.map +1 -1
- package/dist/core/tool-names.d.ts +59 -0
- package/dist/core/tool-names.d.ts.map +1 -0
- package/dist/core/tool-names.js +128 -0
- package/dist/core/tool-names.js.map +1 -0
- package/dist/index.d.ts +227 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +539 -152
- package/dist/index.js.map +1 -1
- package/dist/integrations/claude-agent.d.ts +5 -0
- package/dist/integrations/claude-agent.d.ts.map +1 -1
- package/dist/integrations/claude-agent.js +42 -13
- package/dist/integrations/claude-agent.js.map +1 -1
- package/dist/integrations/google-adk.d.ts +5 -3
- package/dist/integrations/google-adk.d.ts.map +1 -1
- package/dist/integrations/google-adk.js +9 -5
- package/dist/integrations/google-adk.js.map +1 -1
- package/dist/integrations/langchain.d.ts +7 -0
- package/dist/integrations/langchain.d.ts.map +1 -1
- package/dist/integrations/langchain.js +21 -3
- package/dist/integrations/langchain.js.map +1 -1
- package/dist/integrations/openai-agents.d.ts +22 -10
- package/dist/integrations/openai-agents.d.ts.map +1 -1
- package/dist/integrations/openai-agents.js +57 -16
- package/dist/integrations/openai-agents.js.map +1 -1
- package/dist/integrations/openai.d.ts +11 -0
- package/dist/integrations/openai.d.ts.map +1 -1
- package/dist/integrations/openai.js +130 -48
- package/dist/integrations/openai.js.map +1 -1
- package/dist/integrations/vercel-ai.d.ts +20 -9
- package/dist/integrations/vercel-ai.d.ts.map +1 -1
- package/dist/integrations/vercel-ai.js +131 -32
- package/dist/integrations/vercel-ai.js.map +1 -1
- package/dist/render/tokens.d.ts.map +1 -1
- package/dist/render/tokens.js +1 -0
- package/dist/render/tokens.js.map +1 -1
- package/package.json +41 -9
- package/prompts/onboard.md +259 -0
- package/prompts/scan.md +123 -0
- package/skills/SKILL.md +432 -0
- package/contracts/core/llm_safety.yaml +0 -130
|
@@ -75,7 +75,7 @@ agents:
|
|
|
75
75
|
# False negatives mean the secret ships, which is much worse.
|
|
76
76
|
|
|
77
77
|
- desc: "Block writes containing AWS / GCP / Azure / cloud creds"
|
|
78
|
-
|
|
78
|
+
G:
|
|
79
79
|
pattern: arg_blacklist
|
|
80
80
|
args:
|
|
81
81
|
- write
|
|
@@ -88,7 +88,7 @@ agents:
|
|
|
88
88
|
source: "library:tier1.credentials"
|
|
89
89
|
|
|
90
90
|
- desc: "Block writes containing GitHub tokens"
|
|
91
|
-
|
|
91
|
+
G:
|
|
92
92
|
pattern: arg_blacklist
|
|
93
93
|
args:
|
|
94
94
|
- write
|
|
@@ -101,7 +101,7 @@ agents:
|
|
|
101
101
|
source: "library:tier1.credentials"
|
|
102
102
|
|
|
103
103
|
- desc: "Block writes containing payment-processor / SaaS API keys"
|
|
104
|
-
|
|
104
|
+
G:
|
|
105
105
|
pattern: arg_blacklist
|
|
106
106
|
args:
|
|
107
107
|
- write
|
|
@@ -119,7 +119,7 @@ agents:
|
|
|
119
119
|
source: "library:tier1.credentials"
|
|
120
120
|
|
|
121
121
|
- desc: "Block writes containing private keys / SSH material"
|
|
122
|
-
|
|
122
|
+
G:
|
|
123
123
|
pattern: arg_blacklist
|
|
124
124
|
args:
|
|
125
125
|
- write
|
|
@@ -138,7 +138,7 @@ agents:
|
|
|
138
138
|
# ``new_string`` (the canonical `edit` tool's payload field).
|
|
139
139
|
|
|
140
140
|
- desc: "Block edits containing AWS / GCP / Azure / cloud creds"
|
|
141
|
-
|
|
141
|
+
G:
|
|
142
142
|
pattern: arg_blacklist
|
|
143
143
|
args:
|
|
144
144
|
- edit
|
|
@@ -151,7 +151,7 @@ agents:
|
|
|
151
151
|
source: "library:tier1.credentials"
|
|
152
152
|
|
|
153
153
|
- desc: "Block edits containing GitHub tokens"
|
|
154
|
-
|
|
154
|
+
G:
|
|
155
155
|
pattern: arg_blacklist
|
|
156
156
|
args:
|
|
157
157
|
- edit
|
|
@@ -164,7 +164,7 @@ agents:
|
|
|
164
164
|
source: "library:tier1.credentials"
|
|
165
165
|
|
|
166
166
|
- desc: "Block edits containing payment-processor / SaaS API keys"
|
|
167
|
-
|
|
167
|
+
G:
|
|
168
168
|
pattern: arg_blacklist
|
|
169
169
|
args:
|
|
170
170
|
- edit
|
|
@@ -178,7 +178,7 @@ agents:
|
|
|
178
178
|
source: "library:tier1.credentials"
|
|
179
179
|
|
|
180
180
|
- desc: "Block edits containing private keys / SSH material"
|
|
181
|
-
|
|
181
|
+
G:
|
|
182
182
|
pattern: arg_blacklist
|
|
183
183
|
args:
|
|
184
184
|
- edit
|
|
@@ -52,7 +52,7 @@ agents:
|
|
|
52
52
|
# =================================================================
|
|
53
53
|
|
|
54
54
|
- desc: "Ban DROP DATABASE / DROP TABLE / DROP SCHEMA via shell"
|
|
55
|
-
|
|
55
|
+
G:
|
|
56
56
|
pattern: arg_blacklist
|
|
57
57
|
args:
|
|
58
58
|
- exec
|
|
@@ -65,7 +65,7 @@ agents:
|
|
|
65
65
|
source: "library:tier1.database"
|
|
66
66
|
|
|
67
67
|
- desc: "Ban TRUNCATE TABLE via shell (whole-table wipe)"
|
|
68
|
-
|
|
68
|
+
G:
|
|
69
69
|
pattern: arg_blacklist
|
|
70
70
|
args:
|
|
71
71
|
- exec
|
|
@@ -77,7 +77,7 @@ agents:
|
|
|
77
77
|
source: "library:tier1.database"
|
|
78
78
|
|
|
79
79
|
- desc: "Ban unbounded DELETE FROM (no WHERE clause)"
|
|
80
|
-
|
|
80
|
+
G:
|
|
81
81
|
pattern: arg_blacklist
|
|
82
82
|
args:
|
|
83
83
|
- exec
|
|
@@ -95,7 +95,7 @@ agents:
|
|
|
95
95
|
# =================================================================
|
|
96
96
|
|
|
97
97
|
- desc: "Ban dropdb / mysqladmin drop / redis FLUSHALL / FLUSHDB"
|
|
98
|
-
|
|
98
|
+
G:
|
|
99
99
|
pattern: arg_blacklist
|
|
100
100
|
args:
|
|
101
101
|
- exec
|
|
@@ -107,7 +107,7 @@ agents:
|
|
|
107
107
|
source: "library:tier1.database"
|
|
108
108
|
|
|
109
109
|
- desc: "Ban migration rollback to empty schema"
|
|
110
|
-
|
|
110
|
+
G:
|
|
111
111
|
pattern: arg_blacklist
|
|
112
112
|
args:
|
|
113
113
|
- exec
|
|
@@ -125,7 +125,7 @@ agents:
|
|
|
125
125
|
# =================================================================
|
|
126
126
|
|
|
127
127
|
- desc: "Ban deletion of database data directories"
|
|
128
|
-
|
|
128
|
+
G:
|
|
129
129
|
pattern: arg_blacklist
|
|
130
130
|
args:
|
|
131
131
|
- exec
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# sponsio/contracts/capability/destructive.yaml
|
|
3
|
+
#
|
|
4
|
+
# Capability pack — destructive / irreversible operations that the
|
|
5
|
+
# other capability packs don't already cover. Two LTL shapes, both
|
|
6
|
+
# using existing grounding atoms (``called_with``, ``count``,
|
|
7
|
+
# ``count_with``).
|
|
8
|
+
#
|
|
9
|
+
# § A — unconditional deny. ``G: arg_blacklist(...)`` compiles to
|
|
10
|
+
# ``G(called_with(tool, param, regex) -> false)``. No
|
|
11
|
+
# override path; the only way to allow is an operator
|
|
12
|
+
# ``overrides:`` with ``disabled: true``.
|
|
13
|
+
#
|
|
14
|
+
# § B — gated by per-call confirm marker. Raw LTL of the form
|
|
15
|
+
# ``G(called_with(<tool>, <regex>) ->
|
|
16
|
+
# count(confirm_destructive_action) >=
|
|
17
|
+
# count_with(<tool>, <regex>))``.
|
|
18
|
+
# Every destructive call must be matched by a fresh
|
|
19
|
+
# ``confirm_destructive_action`` marker — agent cannot
|
|
20
|
+
# reuse one confirm to cover multiple destructives.
|
|
21
|
+
# Violation = host adapter's choice of how to surface
|
|
22
|
+
# (deny / ask). Mode A hosts (Claude Code,
|
|
23
|
+
# OpenClaw) translate to ``permissionDecision: ask`` /
|
|
24
|
+
# ``requireApproval`` independently of the contract layer.
|
|
25
|
+
#
|
|
26
|
+
# Scope (deliberately narrow):
|
|
27
|
+
#
|
|
28
|
+
# This pack only covers categories the other capability packs
|
|
29
|
+
# miss. Specifically, it does NOT re-cover:
|
|
30
|
+
#
|
|
31
|
+
# - DROP / TRUNCATE / DELETE / dropdb / FLUSHALL / alembic
|
|
32
|
+
# downgrade base / data-dir deletes ── ``database.yaml``
|
|
33
|
+
# already bans these unconditionally; a confirm-marker
|
|
34
|
+
# version would be strictly weaker.
|
|
35
|
+
# - rm -rf of system roots, dd, mkfs, fork bomb ── ``shell.yaml``
|
|
36
|
+
# already bans these unconditionally.
|
|
37
|
+
# - SSH key / dotenv / credentials reads or overwrites ──
|
|
38
|
+
# ``credentials.yaml`` / ``filesystem.yaml``.
|
|
39
|
+
#
|
|
40
|
+
# What this pack adds is the *infra control plane*, *git history*,
|
|
41
|
+
# *mass-file*, and *MCP-tool* layers — categories where the blast
|
|
42
|
+
# radius is "wipe production" but the surface (cloud CLI / HTTP
|
|
43
|
+
# API / MCP tool / git mutation) isn't a shell builtin or SQL
|
|
44
|
+
# statement and so isn't caught by the existing packs.
|
|
45
|
+
#
|
|
46
|
+
# Real-world incidents this pack defends against:
|
|
47
|
+
#
|
|
48
|
+
# - PocketOS / Cursor / Claude Opus 4.6 (2026-04-27): agent in
|
|
49
|
+
# staging deleted production Railway volume + all backups in
|
|
50
|
+
# 9 seconds. § B gating on the Railway CLI form
|
|
51
|
+
# (``railway volume delete``) AND the HTTP API form
|
|
52
|
+
# (``curl -X DELETE backboard.railway.app/...``) would have
|
|
53
|
+
# demanded a per-call confirm marker first. The third form —
|
|
54
|
+
# in-process SDK call from a Python/Node script — sits outside
|
|
55
|
+
# the shell-tool boundary; catching that requires Mode B
|
|
56
|
+
# (`sponsio.Sponsio()` wrapping the agent loop where the SDK
|
|
57
|
+
# `delete_volume` tool call is visible directly).
|
|
58
|
+
# - claude-code issue #30475 (closed-as-duplicate, recurring):
|
|
59
|
+
# "Agent commits and pushes changes without waiting for user
|
|
60
|
+
# approval." § B on force-push to protected branches.
|
|
61
|
+
#
|
|
62
|
+
# Marker convention:
|
|
63
|
+
# ``confirm_destructive_action`` is the integration's signal that
|
|
64
|
+
# the user has explicitly approved a destructive operation
|
|
65
|
+
# through the host UI. Sub-agents are not expected to emit it
|
|
66
|
+
# directly — their work product flows back to the main agent,
|
|
67
|
+
# which surfaces an ``ask``-style confirmation prompt and emits
|
|
68
|
+
# the marker on user approval. Without the marker, every § B
|
|
69
|
+
# call fails the per-call count comparison.
|
|
70
|
+
#
|
|
71
|
+
# This marker is independent of ``shell.yaml``'s
|
|
72
|
+
# ``confirm_reconfirmed`` marker — each pack defines its own so
|
|
73
|
+
# a single user click can't unintentionally satisfy multiple
|
|
74
|
+
# distinct gates.
|
|
75
|
+
#
|
|
76
|
+
# Include via:
|
|
77
|
+
# include:
|
|
78
|
+
# - sponsio:capability/destructive
|
|
79
|
+
#
|
|
80
|
+
# Tool naming:
|
|
81
|
+
# The pack uses canonical ``exec`` for the shell tool. Both
|
|
82
|
+
# ``_host.yaml`` and ``_host_subagent.yaml`` rename ``exec: Bash``;
|
|
83
|
+
# ``_host_openclaw.yaml`` uses canonical ``exec`` directly. For
|
|
84
|
+
# plugin tools (``mcp__<server>__<tool>``) the rule references
|
|
85
|
+
# the namespaced name verbatim.
|
|
86
|
+
#
|
|
87
|
+
# Source tag convention:
|
|
88
|
+
# library:tier1.destructive.{always,confirm}
|
|
89
|
+
# =============================================================================
|
|
90
|
+
|
|
91
|
+
version: "1"
|
|
92
|
+
|
|
93
|
+
tools:
|
|
94
|
+
- name: exec
|
|
95
|
+
description: "Shell command execution"
|
|
96
|
+
params: "command: str"
|
|
97
|
+
- name: confirm_destructive_action
|
|
98
|
+
description: "Marker tool the integration emits when the user explicitly approves a destructive operation."
|
|
99
|
+
params: "operation: str"
|
|
100
|
+
|
|
101
|
+
agents:
|
|
102
|
+
"*":
|
|
103
|
+
contracts:
|
|
104
|
+
|
|
105
|
+
# ===================================================================
|
|
106
|
+
# § A — unconditional deny (G(¬destructive))
|
|
107
|
+
# ===================================================================
|
|
108
|
+
|
|
109
|
+
- desc: "Ban git history rewrites that obliterate state silently (filter-branch / filter-repo)"
|
|
110
|
+
G:
|
|
111
|
+
pattern: arg_blacklist
|
|
112
|
+
args:
|
|
113
|
+
- exec
|
|
114
|
+
- command
|
|
115
|
+
- - "\\bgit\\b[^|;&]*?\\bfilter-(branch|repo)\\b"
|
|
116
|
+
source: "library:tier1.destructive.always"
|
|
117
|
+
|
|
118
|
+
# ===================================================================
|
|
119
|
+
# § B — per-call confirm marker required
|
|
120
|
+
# ===================================================================
|
|
121
|
+
#
|
|
122
|
+
# LTL idiom: G(called_with(t, r) ->
|
|
123
|
+
# count(confirm_destructive_action)
|
|
124
|
+
# >= count_with(t, r))
|
|
125
|
+
#
|
|
126
|
+
# Every match of the destructive regex must be matched by a
|
|
127
|
+
# fresh confirm marker — confirms are not reusable across
|
|
128
|
+
# different destructive ops within the same session.
|
|
129
|
+
|
|
130
|
+
- desc: "git force-push to protected branches needs per-call confirm_destructive_action (PocketOS-class blast radius)"
|
|
131
|
+
G:
|
|
132
|
+
ltl: >-
|
|
133
|
+
G(called_with(exec, "\\bgit\\b[^|;&]*?\\bpush\\b[^|;&]*?(--force|--force-with-lease|\\s-f\\b)[^|;&]*?\\b(main|master|release|prod|production)\\b")
|
|
134
|
+
-> count(confirm_destructive_action)
|
|
135
|
+
>= count_with(exec, "\\bgit\\b[^|;&]*?\\bpush\\b[^|;&]*?(--force|--force-with-lease|\\s-f\\b)[^|;&]*?\\b(main|master|release|prod|production)\\b"))
|
|
136
|
+
source: "library:tier1.destructive.confirm"
|
|
137
|
+
|
|
138
|
+
- desc: "git reset --hard / clean -fdx needs per-call confirm_destructive_action (drops local work)"
|
|
139
|
+
G:
|
|
140
|
+
ltl: >-
|
|
141
|
+
G(called_with(exec, "\\bgit\\b[^|;&]*?\\b(reset\\b[^|;&]*?\\b--hard|clean\\b[^|;&]*?\\b-[fdx]+)\\b")
|
|
142
|
+
-> count(confirm_destructive_action)
|
|
143
|
+
>= count_with(exec, "\\bgit\\b[^|;&]*?\\b(reset\\b[^|;&]*?\\b--hard|clean\\b[^|;&]*?\\b-[fdx]+)\\b"))
|
|
144
|
+
source: "library:tier1.destructive.confirm"
|
|
145
|
+
|
|
146
|
+
- desc: "Cloud volume / cluster delete needs per-call confirm_destructive_action (PocketOS Railway pattern)"
|
|
147
|
+
G:
|
|
148
|
+
ltl: >-
|
|
149
|
+
G(called_with(exec, "\\b(railway\\s+(volume|service|environment|project)\\s+delete|aws\\s+ec2\\s+delete-volume|aws\\s+rds\\s+delete-(db-instance|db-cluster|db-snapshot)|aws\\s+s3\\s+rb|gcloud\\s+(sql|compute|container)\\s+\\S+\\s+delete|kubectl\\s+delete\\s+(pv|pvc|namespace|cluster)|fly\\s+(volumes|apps)\\s+destroy|heroku\\s+apps:destroy|terraform\\s+destroy|pulumi\\s+destroy|docker\\s+volume\\s+rm)\\b")
|
|
150
|
+
-> count(confirm_destructive_action)
|
|
151
|
+
>= count_with(exec, "\\b(railway\\s+(volume|service|environment|project)\\s+delete|aws\\s+ec2\\s+delete-volume|aws\\s+rds\\s+delete-(db-instance|db-cluster|db-snapshot)|aws\\s+s3\\s+rb|gcloud\\s+(sql|compute|container)\\s+\\S+\\s+delete|kubectl\\s+delete\\s+(pv|pvc|namespace|cluster)|fly\\s+(volumes|apps)\\s+destroy|heroku\\s+apps:destroy|terraform\\s+destroy|pulumi\\s+destroy|docker\\s+volume\\s+rm)\\b"))
|
|
152
|
+
source: "library:tier1.destructive.confirm"
|
|
153
|
+
|
|
154
|
+
- desc: "GitHub MCP delete_repository needs per-call confirm_destructive_action"
|
|
155
|
+
G:
|
|
156
|
+
ltl: >-
|
|
157
|
+
G(called(mcp__github__delete_repository)
|
|
158
|
+
-> count(confirm_destructive_action) >= count(mcp__github__delete_repository))
|
|
159
|
+
source: "library:tier1.destructive.confirm"
|
|
160
|
+
|
|
161
|
+
- desc: "Railway MCP delete_volume needs per-call confirm_destructive_action (PocketOS pattern)"
|
|
162
|
+
G:
|
|
163
|
+
ltl: >-
|
|
164
|
+
G(called(mcp__railway__delete_volume)
|
|
165
|
+
-> count(confirm_destructive_action) >= count(mcp__railway__delete_volume))
|
|
166
|
+
source: "library:tier1.destructive.confirm"
|
|
167
|
+
|
|
168
|
+
- desc: "AWS MCP delete_volume needs per-call confirm_destructive_action"
|
|
169
|
+
G:
|
|
170
|
+
ltl: >-
|
|
171
|
+
G(called(mcp__aws__delete_volume)
|
|
172
|
+
-> count(confirm_destructive_action) >= count(mcp__aws__delete_volume))
|
|
173
|
+
source: "library:tier1.destructive.confirm"
|
|
174
|
+
|
|
175
|
+
- desc: "Supabase MCP delete_database needs per-call confirm_destructive_action"
|
|
176
|
+
G:
|
|
177
|
+
ltl: >-
|
|
178
|
+
G(called(mcp__supabase__delete_database)
|
|
179
|
+
-> count(confirm_destructive_action) >= count(mcp__supabase__delete_database))
|
|
180
|
+
source: "library:tier1.destructive.confirm"
|
|
181
|
+
|
|
182
|
+
- desc: "GitHub repo deletion via gh CLI needs per-call confirm_destructive_action"
|
|
183
|
+
G:
|
|
184
|
+
ltl: >-
|
|
185
|
+
G(called_with(exec, "\\b(gh\\s+repo\\s+delete|hub\\s+delete)\\b")
|
|
186
|
+
-> count(confirm_destructive_action)
|
|
187
|
+
>= count_with(exec, "\\b(gh\\s+repo\\s+delete|hub\\s+delete)\\b"))
|
|
188
|
+
source: "library:tier1.destructive.confirm"
|
|
189
|
+
|
|
190
|
+
- desc: "Mass file delete (find -delete / xargs rm) needs per-call confirm_destructive_action"
|
|
191
|
+
G:
|
|
192
|
+
ltl: >-
|
|
193
|
+
G(called_with(exec, "\\bfind\\s+\\S+[^|;&]*?(\\s-delete|\\|\\s*xargs\\s+rm)\\b")
|
|
194
|
+
-> count(confirm_destructive_action)
|
|
195
|
+
>= count_with(exec, "\\bfind\\s+\\S+[^|;&]*?(\\s-delete|\\|\\s*xargs\\s+rm)\\b"))
|
|
196
|
+
source: "library:tier1.destructive.confirm"
|
|
197
|
+
|
|
198
|
+
# PocketOS / Cursor (2026-04-27) almost certainly went through
|
|
199
|
+
# the Railway HTTP API, not the CLI — "single API call to
|
|
200
|
+
# Railway" is the operative wording. curl / wget / httpie / xh
|
|
201
|
+
# carrying DELETE to known infra endpoints (Railway, AWS,
|
|
202
|
+
# GCP, Heroku, Fly, Vercel, DO, Linode, Cloudflare, Supabase)
|
|
203
|
+
# gates on the same confirm marker. Generic curl with DELETE
|
|
204
|
+
# to arbitrary URLs is intentionally NOT gated here — too many
|
|
205
|
+
# legitimate REST API uses; users get the gate exactly where
|
|
206
|
+
# the blast radius is "wipe production infra".
|
|
207
|
+
- desc: "HTTP DELETE to cloud infra control planes needs per-call confirm_destructive_action (PocketOS API path)"
|
|
208
|
+
G:
|
|
209
|
+
ltl: >-
|
|
210
|
+
G(called_with(exec, "\\b(curl|wget|http|https|httpie|xh)\\b[^|;&]*?(-X\\s+DELETE|--request\\s+DELETE|\\sDELETE\\b)[^|;&]*?(railway\\.app|amazonaws\\.com|googleapis\\.com|heroku\\.com|fly\\.io|vercel\\.com|digitalocean\\.com|linode\\.com|cloudflare\\.com|supabase\\.co|planetscale\\.com|neon\\.tech|render\\.com|fly\\.dev|backboard\\.railway\\.app)")
|
|
211
|
+
-> count(confirm_destructive_action)
|
|
212
|
+
>= count_with(exec, "\\b(curl|wget|http|https|httpie|xh)\\b[^|;&]*?(-X\\s+DELETE|--request\\s+DELETE|\\sDELETE\\b)[^|;&]*?(railway\\.app|amazonaws\\.com|googleapis\\.com|heroku\\.com|fly\\.io|vercel\\.com|digitalocean\\.com|linode\\.com|cloudflare\\.com|supabase\\.co|planetscale\\.com|neon\\.tech|render\\.com|fly\\.dev|backboard\\.railway\\.app)"))
|
|
213
|
+
source: "library:tier1.destructive.confirm"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# sponsio/contracts/capability/factual-claims.yaml
|
|
3
|
+
#
|
|
4
|
+
# Capability pack — evidence obligations for factual claims.
|
|
5
|
+
#
|
|
6
|
+
# REQUIRES A SPONSIO CLOUD KEY. Verdicts are produced by the cloud
|
|
7
|
+
# evidence API (POST /v1/evidence/verify); the runtime computes none of
|
|
8
|
+
# them. The integration calls ``client.evidence.verify(...)`` and feeds
|
|
9
|
+
# ``EvidenceResult.to_event(...)`` into the trace; that grounds three
|
|
10
|
+
# atom families this pack composes:
|
|
11
|
+
#
|
|
12
|
+
# claim_emitted(pred) a claim of this predicate was emitted
|
|
13
|
+
# evidence_verdict(pred, V) the server's verdict for it (PASS /
|
|
14
|
+
# MISMATCH / UNDERDETERMINED /
|
|
15
|
+
# NO_EVIDENCE / STALE /
|
|
16
|
+
# SOURCE_UNAVAILABLE /
|
|
17
|
+
# EXTRACTION_AMBIGUOUS)
|
|
18
|
+
# evidence_action(pred, a) the server's policy action
|
|
19
|
+
# (release / block / clarify /
|
|
20
|
+
# re_resolve)
|
|
21
|
+
#
|
|
22
|
+
# Two shapes:
|
|
23
|
+
#
|
|
24
|
+
# § A — claim_requires_evidence(pred):
|
|
25
|
+
# G(claim_emitted(pred) -> evidence_verdict(pred, PASS)).
|
|
26
|
+
# Any claim whose verdict is not PASS violates at the timestep
|
|
27
|
+
# the verdict lands.
|
|
28
|
+
#
|
|
29
|
+
# § B — underdetermined_must_clarify(pred):
|
|
30
|
+
# G(evidence_verdict(pred, UNDERDETERMINED) ->
|
|
31
|
+
# evidence_action(pred, clarify)).
|
|
32
|
+
# Guards the policy wiring: ambiguous evidence must resolve to
|
|
33
|
+
# a clarify action, never a silent release.
|
|
34
|
+
#
|
|
35
|
+
# Without a cloud key no ``evidence`` events exist, both atom families
|
|
36
|
+
# stay un-grounded, and every rule below is vacuously satisfied — the
|
|
37
|
+
# pack does nothing rather than something wrong.
|
|
38
|
+
#
|
|
39
|
+
# The predicate names below are the two self-serve built-ins used across
|
|
40
|
+
# the docs; replace them with the predicates your project actually
|
|
41
|
+
# protects (GET /v1/evidence/predicates lists them).
|
|
42
|
+
#
|
|
43
|
+
# Include via:
|
|
44
|
+
# include:
|
|
45
|
+
# - sponsio:capability/factual-claims
|
|
46
|
+
# =============================================================================
|
|
47
|
+
|
|
48
|
+
agents:
|
|
49
|
+
"*":
|
|
50
|
+
contracts:
|
|
51
|
+
|
|
52
|
+
# ===================================================================
|
|
53
|
+
# § A — claims must verify (PASS or it doesn't ship)
|
|
54
|
+
# ===================================================================
|
|
55
|
+
|
|
56
|
+
- desc: "Weekday claims must match the calendar (cloud-verified)"
|
|
57
|
+
G:
|
|
58
|
+
pattern: claim_requires_evidence
|
|
59
|
+
args:
|
|
60
|
+
- date_weekday_agreement
|
|
61
|
+
source: "library:evidence.factual-claims"
|
|
62
|
+
|
|
63
|
+
- desc: "ZIP claims for a city must verify against reference data (cloud-verified)"
|
|
64
|
+
G:
|
|
65
|
+
pattern: claim_requires_evidence
|
|
66
|
+
args:
|
|
67
|
+
- city_zip_candidates
|
|
68
|
+
source: "library:evidence.factual-claims"
|
|
69
|
+
|
|
70
|
+
# ===================================================================
|
|
71
|
+
# § B — ambiguous evidence must clarify, never silently release
|
|
72
|
+
# ===================================================================
|
|
73
|
+
|
|
74
|
+
- desc: "Ambiguous city→ZIP evidence must trigger clarification"
|
|
75
|
+
G:
|
|
76
|
+
pattern: underdetermined_must_clarify
|
|
77
|
+
args:
|
|
78
|
+
- city_zip_candidates
|
|
79
|
+
source: "library:evidence.factual-claims"
|
|
@@ -53,7 +53,7 @@ agents:
|
|
|
53
53
|
# =================================================================
|
|
54
54
|
|
|
55
55
|
- desc: "Writes restricted to workspace"
|
|
56
|
-
|
|
56
|
+
G:
|
|
57
57
|
pattern: scope_limit
|
|
58
58
|
args:
|
|
59
59
|
- write
|
|
@@ -61,7 +61,7 @@ agents:
|
|
|
61
61
|
source: "library:tier1.filesystem-strict"
|
|
62
62
|
|
|
63
63
|
- desc: "In-place edits restricted to workspace"
|
|
64
|
-
|
|
64
|
+
G:
|
|
65
65
|
pattern: scope_limit
|
|
66
66
|
args:
|
|
67
67
|
- edit
|
|
@@ -69,7 +69,7 @@ agents:
|
|
|
69
69
|
source: "library:tier1.filesystem-strict"
|
|
70
70
|
|
|
71
71
|
- desc: "Patch application restricted to workspace"
|
|
72
|
-
|
|
72
|
+
G:
|
|
73
73
|
pattern: scope_limit
|
|
74
74
|
args:
|
|
75
75
|
- apply_patch
|
|
@@ -82,7 +82,7 @@ agents:
|
|
|
82
82
|
# sensitive-path blacklist in the base ``filesystem`` pack
|
|
83
83
|
# keeps secrets hard-denied under any of these roots.
|
|
84
84
|
- desc: "Reads restricted to workspace, /tmp, and read-only system paths"
|
|
85
|
-
|
|
85
|
+
G:
|
|
86
86
|
pattern: scope_limit
|
|
87
87
|
args:
|
|
88
88
|
- read
|
|
@@ -67,7 +67,7 @@ agents:
|
|
|
67
67
|
# `crontab` is end-anchored to avoid matching paths like
|
|
68
68
|
# `/projects/crontab-tests/` or `mycrontab.txt`.
|
|
69
69
|
- desc: "Deny reads of SSH keys, AWS credentials, browser keychains, dotenv secrets"
|
|
70
|
-
|
|
70
|
+
G:
|
|
71
71
|
pattern: arg_blacklist
|
|
72
72
|
args:
|
|
73
73
|
- read
|
|
@@ -96,7 +96,7 @@ agents:
|
|
|
96
96
|
source: "library:tier1.filesystem"
|
|
97
97
|
|
|
98
98
|
- desc: "Deny writes / edits into sensitive paths (prevent persistence or cred overwrite)"
|
|
99
|
-
|
|
99
|
+
G:
|
|
100
100
|
pattern: arg_blacklist
|
|
101
101
|
args:
|
|
102
102
|
- write
|
|
@@ -114,7 +114,7 @@ agents:
|
|
|
114
114
|
source: "library:tier1.filesystem"
|
|
115
115
|
|
|
116
116
|
- desc: "Same denial applies to in-place edits"
|
|
117
|
-
|
|
117
|
+
G:
|
|
118
118
|
pattern: arg_blacklist
|
|
119
119
|
args:
|
|
120
120
|
- edit
|
|
@@ -131,7 +131,7 @@ agents:
|
|
|
131
131
|
source: "library:tier1.filesystem"
|
|
132
132
|
|
|
133
133
|
- desc: "And to unified-diff patches"
|
|
134
|
-
|
|
134
|
+
G:
|
|
135
135
|
pattern: arg_blacklist
|
|
136
136
|
args:
|
|
137
137
|
- apply_patch
|
|
@@ -165,13 +165,13 @@ agents:
|
|
|
165
165
|
# =================================================================
|
|
166
166
|
|
|
167
167
|
- desc: "Must read a file before editing it (no blind patches)"
|
|
168
|
-
|
|
168
|
+
G:
|
|
169
169
|
pattern: must_precede
|
|
170
170
|
args: [read, edit]
|
|
171
171
|
source: "library:tier1.filesystem"
|
|
172
172
|
|
|
173
173
|
- desc: "Must read a file before apply_patch (no blind diffs)"
|
|
174
|
-
|
|
174
|
+
G:
|
|
175
175
|
pattern: must_precede
|
|
176
176
|
args: [read, apply_patch]
|
|
177
177
|
source: "library:tier1.filesystem"
|
|
@@ -191,12 +191,12 @@ agents:
|
|
|
191
191
|
# =================================================================
|
|
192
192
|
|
|
193
193
|
- desc: "Editing bootstrap / system-prompt files requires human confirmation"
|
|
194
|
-
|
|
194
|
+
G:
|
|
195
195
|
ltl: 'G(called_with(edit, "(AGENTS|SOUL|IDENTITY|USER|CLAUDE|\\.cursorrules)\\.md?") -> count(confirm_reconfirmed) >= count_with(edit, "(AGENTS|SOUL|IDENTITY|USER|CLAUDE|\\.cursorrules)\\.md?"))'
|
|
196
196
|
source: "library:tier1.filesystem"
|
|
197
197
|
|
|
198
198
|
- desc: "apply_patch against bootstrap files requires confirmation"
|
|
199
|
-
|
|
199
|
+
G:
|
|
200
200
|
ltl: 'G(called_with(apply_patch, "(AGENTS|SOUL|IDENTITY|USER|CLAUDE|\\.cursorrules)\\.md?") -> count(confirm_reconfirmed) >= count_with(apply_patch, "(AGENTS|SOUL|IDENTITY|USER|CLAUDE|\\.cursorrules)\\.md?"))'
|
|
201
201
|
source: "library:tier1.filesystem"
|
|
202
202
|
|
|
@@ -213,7 +213,7 @@ agents:
|
|
|
213
213
|
# =================================================================
|
|
214
214
|
|
|
215
215
|
- desc: "Data read from filesystem must not flow to outbound messages"
|
|
216
|
-
|
|
216
|
+
G:
|
|
217
217
|
pattern: no_data_leak
|
|
218
218
|
args: [read, send_message]
|
|
219
219
|
source: "library:tier1.filesystem"
|