@sponsio/sdk 0.2.0-alpha.4 → 0.2.0-alpha.8

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.
Files changed (85) hide show
  1. package/contracts/capability/destructive.yaml +213 -0
  2. package/contracts/capability/factual-claims.yaml +79 -0
  3. package/contracts/capability/host-config-integrity.yaml +42 -9
  4. package/contracts/capability/self-modify.yaml +32 -1
  5. package/contracts/capability/shell.yaml +19 -10
  6. package/contracts/incident/claude-code-secret-bypass.yaml +46 -14
  7. package/contracts/incident/cursor-railway-wipe.yaml +60 -4
  8. package/contracts/incident/openclaw.yaml +9 -63
  9. package/dist/cli/cli.js +32 -0
  10. package/dist/cli/cli.js.map +1 -1
  11. package/dist/cli/packs.d.ts.map +1 -1
  12. package/dist/cli/packs.js +13 -7
  13. package/dist/cli/packs.js.map +1 -1
  14. package/dist/cloud/client.d.ts +76 -0
  15. package/dist/cloud/client.d.ts.map +1 -0
  16. package/dist/cloud/client.js +198 -0
  17. package/dist/cloud/client.js.map +1 -0
  18. package/dist/cloud/evidence.d.ts +108 -0
  19. package/dist/cloud/evidence.d.ts.map +1 -0
  20. package/dist/cloud/evidence.js +184 -0
  21. package/dist/cloud/evidence.js.map +1 -0
  22. package/dist/cloud/privacy.d.ts +67 -0
  23. package/dist/cloud/privacy.d.ts.map +1 -0
  24. package/dist/cloud/privacy.js +170 -0
  25. package/dist/cloud/privacy.js.map +1 -0
  26. package/dist/cloud/view-model.d.ts +49 -0
  27. package/dist/cloud/view-model.d.ts.map +1 -0
  28. package/dist/cloud/view-model.js +172 -0
  29. package/dist/cloud/view-model.js.map +1 -0
  30. package/dist/core/config-loader.js +16 -0
  31. package/dist/core/config-loader.js.map +1 -1
  32. package/dist/core/evaluator.d.ts +2 -0
  33. package/dist/core/evaluator.d.ts.map +1 -1
  34. package/dist/core/evaluator.js +90 -4
  35. package/dist/core/evaluator.js.map +1 -1
  36. package/dist/core/grounding.d.ts +43 -7
  37. package/dist/core/grounding.d.ts.map +1 -1
  38. package/dist/core/grounding.js +180 -25
  39. package/dist/core/grounding.js.map +1 -1
  40. package/dist/core/nl-parser.d.ts +1 -1
  41. package/dist/core/nl-parser.d.ts.map +1 -1
  42. package/dist/core/nl-parser.js +616 -40
  43. package/dist/core/nl-parser.js.map +1 -1
  44. package/dist/core/pattern-factory.d.ts.map +1 -1
  45. package/dist/core/pattern-factory.js +7 -1
  46. package/dist/core/pattern-factory.js.map +1 -1
  47. package/dist/core/patterns.d.ts +69 -0
  48. package/dist/core/patterns.d.ts.map +1 -1
  49. package/dist/core/patterns.js +133 -10
  50. package/dist/core/patterns.js.map +1 -1
  51. package/dist/core/tool-names.d.ts +59 -0
  52. package/dist/core/tool-names.d.ts.map +1 -0
  53. package/dist/core/tool-names.js +128 -0
  54. package/dist/core/tool-names.js.map +1 -0
  55. package/dist/index.d.ts +144 -0
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +367 -32
  58. package/dist/index.js.map +1 -1
  59. package/dist/integrations/claude-agent.d.ts +5 -0
  60. package/dist/integrations/claude-agent.d.ts.map +1 -1
  61. package/dist/integrations/claude-agent.js +42 -13
  62. package/dist/integrations/claude-agent.js.map +1 -1
  63. package/dist/integrations/google-adk.d.ts +5 -3
  64. package/dist/integrations/google-adk.d.ts.map +1 -1
  65. package/dist/integrations/google-adk.js +9 -5
  66. package/dist/integrations/google-adk.js.map +1 -1
  67. package/dist/integrations/langchain.d.ts +7 -0
  68. package/dist/integrations/langchain.d.ts.map +1 -1
  69. package/dist/integrations/langchain.js +21 -3
  70. package/dist/integrations/langchain.js.map +1 -1
  71. package/dist/integrations/openai-agents.d.ts +22 -10
  72. package/dist/integrations/openai-agents.d.ts.map +1 -1
  73. package/dist/integrations/openai-agents.js +51 -12
  74. package/dist/integrations/openai-agents.js.map +1 -1
  75. package/dist/integrations/openai.d.ts +11 -0
  76. package/dist/integrations/openai.d.ts.map +1 -1
  77. package/dist/integrations/openai.js +130 -48
  78. package/dist/integrations/openai.js.map +1 -1
  79. package/dist/integrations/vercel-ai.d.ts +20 -9
  80. package/dist/integrations/vercel-ai.d.ts.map +1 -1
  81. package/dist/integrations/vercel-ai.js +131 -50
  82. package/dist/integrations/vercel-ai.js.map +1 -1
  83. package/package.json +12 -8
  84. package/prompts/onboard.md +17 -4
  85. 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.