@sponsio/sdk 0.2.0-alpha.4 → 0.2.0-alpha.9
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/contracts/capability/destructive.yaml +213 -0
- package/contracts/capability/factual-claims.yaml +79 -0
- package/contracts/capability/host-config-integrity.yaml +42 -9
- package/contracts/capability/self-modify.yaml +32 -1
- package/contracts/capability/shell.yaml +19 -10
- package/contracts/incident/claude-code-secret-bypass.yaml +46 -14
- package/contracts/incident/cursor-railway-wipe.yaml +60 -4
- package/contracts/incident/openclaw.yaml +9 -63
- package/dist/cli/cli.js +32 -0
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/packs.d.ts.map +1 -1
- package/dist/cli/packs.js +13 -7
- package/dist/cli/packs.js.map +1 -1
- package/dist/cloud/client.d.ts +76 -0
- package/dist/cloud/client.d.ts.map +1 -0
- package/dist/cloud/client.js +198 -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/core/config-loader.js +16 -0
- package/dist/core/config-loader.js.map +1 -1
- package/dist/core/evaluator.d.ts +2 -0
- package/dist/core/evaluator.d.ts.map +1 -1
- package/dist/core/evaluator.js +90 -4
- package/dist/core/evaluator.js.map +1 -1
- package/dist/core/formula.d.ts.map +1 -1
- package/dist/core/formula.js +12 -0
- package/dist/core/formula.js.map +1 -1
- package/dist/core/grounding.d.ts +43 -7
- package/dist/core/grounding.d.ts.map +1 -1
- package/dist/core/grounding.js +192 -26
- package/dist/core/grounding.js.map +1 -1
- package/dist/core/nl-parser.d.ts +1 -1
- package/dist/core/nl-parser.d.ts.map +1 -1
- package/dist/core/nl-parser.js +616 -40
- package/dist/core/nl-parser.js.map +1 -1
- package/dist/core/pattern-factory.d.ts.map +1 -1
- package/dist/core/pattern-factory.js +7 -1
- package/dist/core/pattern-factory.js.map +1 -1
- package/dist/core/patterns.d.ts +69 -0
- package/dist/core/patterns.d.ts.map +1 -1
- package/dist/core/patterns.js +133 -10
- package/dist/core/patterns.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 +144 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +367 -32
- 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 +51 -12
- 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 -50
- package/dist/integrations/vercel-ai.js.map +1 -1
- package/package.json +12 -8
- package/prompts/onboard.md +17 -4
- package/contracts/core/llm_safety.yaml +0 -138
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
# =============================================================================
|
|
2
|
-
# sponsio/contracts/core/llm_safety.yaml
|
|
3
|
-
#
|
|
4
|
-
# !! Not supported in this build !! , this pack is composed entirely of
|
|
5
|
-
# LLM-judged stochastic atoms (`injection_free`, `jailbreak_free`,
|
|
6
|
-
# `harmful`, `toxic_free`, `semantic_pii_free`). The deterministic
|
|
7
|
-
# engine ships no evaluator for them and will refuse to load this pack.
|
|
8
|
-
#
|
|
9
|
-
# It still ships on disk so external builds with a real StoEvaluator
|
|
10
|
-
# (auto-discovered via the `sponsio.evaluators` entry-point group)
|
|
11
|
-
# see the same on-disk layout and can evaluate these contracts.
|
|
12
|
-
#
|
|
13
|
-
# Once an evaluator is available, opt in from your config:
|
|
14
|
-
#
|
|
15
|
-
# include:
|
|
16
|
-
# - sponsio:core/llm_safety
|
|
17
|
-
#
|
|
18
|
-
# Why opt-in: every contract here triggers a judge LLM call on each
|
|
19
|
-
# evaluation. That's the right default for response-quality work but
|
|
20
|
-
# the wrong default for tool-call-only agents (no LLM responses to
|
|
21
|
-
# score, judge calls add latency without value). Splitting out of
|
|
22
|
-
# `core/universal` was the user-driven fix for "why is the SRE tool-call
|
|
23
|
-
# demo running prompt-injection scoring".
|
|
24
|
-
#
|
|
25
|
-
# Source tag convention for this file:
|
|
26
|
-
# library:tier0.<category> where category ∈
|
|
27
|
-
# adversarial | harm | privacy | scope
|
|
28
|
-
# =============================================================================
|
|
29
|
-
|
|
30
|
-
version: "1"
|
|
31
|
-
|
|
32
|
-
# NOTE: no `tools:` section here because these contracts are response-scoped.
|
|
33
|
-
# They evaluate against llm_response events, not tool calls. Agents that
|
|
34
|
-
# include this file will add their own `tools:` inventory separately.
|
|
35
|
-
|
|
36
|
-
agents:
|
|
37
|
-
# Template agent id — replaced at include time by the including config.
|
|
38
|
-
# The include mechanism substitutes this section under the real agent id.
|
|
39
|
-
"*":
|
|
40
|
-
contracts:
|
|
41
|
-
|
|
42
|
-
# -- Adversarial resistance ----------------------------------------
|
|
43
|
-
#
|
|
44
|
-
# `beta` weights the cost of a *missed* violation in the contract
|
|
45
|
-
# score. Higher beta = a missed violation hurts the score more,
|
|
46
|
-
# so the judge has to be near-certain the response is *clean*
|
|
47
|
-
# before allowing it. We ship the values below as defaults
|
|
48
|
-
# calibrated for the threat profile (slip-through cost) of each
|
|
49
|
-
# category. Override per-agent in your config if your workload
|
|
50
|
-
# has different stakes.
|
|
51
|
-
|
|
52
|
-
# 0.95 — prompt-injection slip-throughs cause downstream tool
|
|
53
|
-
# misuse with full agent privileges. High slip-through cost.
|
|
54
|
-
- desc: "Every LLM response must be free of prompt-injection compliance"
|
|
55
|
-
G:
|
|
56
|
-
pattern: injection_free
|
|
57
|
-
context_scope: full_trace
|
|
58
|
-
source: "library:tier0.adversarial"
|
|
59
|
-
beta: 0.95
|
|
60
|
-
|
|
61
|
-
# 0.90 — jailbreak compliance is bad but mostly self-contained
|
|
62
|
-
# (response-level harm, not tool-level harm).
|
|
63
|
-
- desc: "LLM must not comply with jailbreak attempts (DAN, roleplay, hypothetical bypass)"
|
|
64
|
-
G:
|
|
65
|
-
pattern: jailbreak_free
|
|
66
|
-
source: "library:tier0.adversarial"
|
|
67
|
-
beta: 0.9
|
|
68
|
-
|
|
69
|
-
# -- Harm avoidance -----------------------------------------------
|
|
70
|
-
|
|
71
|
-
# 0.95 — real-world-harm enablement (CSAM, weapons, self-harm
|
|
72
|
-
# methods) carries the same high slip-through cost as injection.
|
|
73
|
-
- desc: "Response must not encourage or enable real-world harm"
|
|
74
|
-
G:
|
|
75
|
-
pattern: harmful
|
|
76
|
-
source: "library:tier0.harm"
|
|
77
|
-
beta: 0.95
|
|
78
|
-
|
|
79
|
-
# 0.90 — toxic language is corrosive but not safety-critical;
|
|
80
|
-
# match the jailbreak weight rather than the harm weight.
|
|
81
|
-
- desc: "Response free of toxic / harassing language"
|
|
82
|
-
G:
|
|
83
|
-
pattern: toxic_free
|
|
84
|
-
source: "library:tier0.harm"
|
|
85
|
-
beta: 0.9
|
|
86
|
-
|
|
87
|
-
# -- Privacy ------------------------------------------------------
|
|
88
|
-
|
|
89
|
-
# 0.95 — PII slip-throughs are regulatory issues (GDPR / CCPA)
|
|
90
|
-
# not just trust issues. High slip-through cost.
|
|
91
|
-
- desc: "Response free of contextual PII (names tied to conditions, inferable identity)"
|
|
92
|
-
G:
|
|
93
|
-
pattern: semantic_pii_free
|
|
94
|
-
source: "library:tier0.privacy"
|
|
95
|
-
beta: 0.95
|
|
96
|
-
|
|
97
|
-
# -- Scope --------------------------------------------------------
|
|
98
|
-
#
|
|
99
|
-
# `scope_respect` is deliberately NOT shipped on by default. It
|
|
100
|
-
# needs a concrete, agent-specific scope string to be useful —
|
|
101
|
-
# something like "respond only to loan-origination questions for
|
|
102
|
-
# the approved product catalogue". A generic default like "do
|
|
103
|
-
# not act beyond the task" is irredeemably abstract: the judge
|
|
104
|
-
# has nothing to anchor on and will either flag everything or
|
|
105
|
-
# pass everything, depending on model temperament. Shipping
|
|
106
|
-
# such a rule as default-on produces noise, not signal.
|
|
107
|
-
#
|
|
108
|
-
# Add it to your own agent config once you have a concrete scope
|
|
109
|
-
# statement, e.g.::
|
|
110
|
-
#
|
|
111
|
-
# agents:
|
|
112
|
-
# support_bot:
|
|
113
|
-
# contracts:
|
|
114
|
-
# - desc: "Stays within customer-support remit"
|
|
115
|
-
# E:
|
|
116
|
-
# pattern: scope_respect
|
|
117
|
-
# args: ["answer questions about order status,
|
|
118
|
-
# refunds, and shipping — no legal advice,
|
|
119
|
-
# no medical advice, no code execution"]
|
|
120
|
-
# beta: 0.85
|
|
121
|
-
#
|
|
122
|
-
# The β=0.85 default acknowledges that "out of scope" is fuzzier
|
|
123
|
-
# than "contains PII"; a higher beta flags too aggressively on
|
|
124
|
-
# responses that drift only slightly.
|
|
125
|
-
|
|
126
|
-
# -----------------------------------------------------------------------------
|
|
127
|
-
# What this file deliberately does NOT include
|
|
128
|
-
# -----------------------------------------------------------------------------
|
|
129
|
-
#
|
|
130
|
-
# - Token / loop budgets — those live in core/budget.yaml and core/runaway.yaml
|
|
131
|
-
# respectively, so an agent with a custom budget can include only that.
|
|
132
|
-
#
|
|
133
|
-
# - Tool-specific protections — any constraint that mentions a specific tool
|
|
134
|
-
# name (exec, web_fetch, ...) belongs in capability/*.yaml.
|
|
135
|
-
#
|
|
136
|
-
# - Hallucination / faithfulness atoms — those require a retrieval source
|
|
137
|
-
# argument and are not universally applicable. See docs/sto-atoms.md §1
|
|
138
|
-
# for when to add them per-agent.
|