@synapsor/runner 0.1.12 → 0.1.14

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.
@@ -0,0 +1,79 @@
1
+ # Threat Model
2
+
3
+ Synapsor Runner protects one narrow boundary: model-facing MCP database actions that go through reviewed Synapsor capabilities and guarded writeback jobs.
4
+
5
+ It is not a general MCP security gateway, not a prompt-injection cure, not a replacement for host security, and not a self-hosted copy of Synapsor Cloud.
6
+
7
+ ## Assets
8
+
9
+ - Customer Postgres/MySQL credentials.
10
+ - Business rows targeted by model-facing workflows.
11
+ - Trusted tenant, principal, source, object, allowed-column, and version bindings.
12
+ - Proposal diffs, evidence bundles, query audit, approvals, writeback jobs, receipts, and replay records.
13
+ - Runner token and local SQLite proposal store.
14
+
15
+ ## Trust Boundaries
16
+
17
+ ```text
18
+ MCP client/model
19
+ -> Synapsor Runner MCP server
20
+ -> reviewed capability config
21
+ -> read-only database credential
22
+ -> local proposal/evidence/replay store
23
+ -> human approval outside the model
24
+ -> guarded worker with write credential
25
+ -> Postgres/MySQL
26
+ ```
27
+
28
+ In Cloud-linked mode:
29
+
30
+ ```text
31
+ MCP client/model
32
+ -> local Synapsor Runner MCP server
33
+ -> Synapsor Cloud adapter/capability API
34
+ -> Cloud proposal/approval/replay/job lease
35
+ -> local guarded worker
36
+ -> Postgres/MySQL
37
+ ```
38
+
39
+ The model-facing MCP tool call has request/proposal authority. The trusted runner has execution authority only for already-approved, scoped writeback jobs.
40
+
41
+ ## Covered Threats
42
+
43
+ - Model asks for arbitrary SQL: no generic SQL tool is exposed in the Synapsor path.
44
+ - Model supplies `tenant_id`, `principal`, source id, allowed columns, row version, or approval identity: runner rejects trusted-binding overrides.
45
+ - Prompt injection in database content asks the model to bypass policy: the runner ignores text as authority and only accepts structured capability/job state.
46
+ - Wrong tenant or object: reads and writes include trusted primary-key and tenant predicates.
47
+ - Disallowed field update: patch columns must be allowlisted.
48
+ - Stale row: conflict guard mismatch returns `conflict` instead of silently writing.
49
+ - Duplicate retry: receipt/idempotency state prevents applying the same job twice.
50
+ - Over-broad update: only single-row `UPDATE` is supported and success requires exactly one affected row.
51
+ - Cloud credential leakage: database URLs and write credentials stay local and are not sent to Cloud.
52
+ - Model-callable approval: approval/commit tools are not exposed to MCP clients by default.
53
+
54
+ ## Not Covered
55
+
56
+ - A compromised local host, MCP host, or modified runner binary.
57
+ - A malicious or compromised non-Synapsor MCP server.
58
+ - Credential theft outside the runner process.
59
+ - OAuth, SSRF, token-passthrough, or confused-deputy bugs in unrelated MCP systems.
60
+ - Sensitive data already returned to a model.
61
+ - Prompt injection itself.
62
+ - Business invariants not represented in the capability config, proposal, application handler, or database constraints.
63
+ - Multi-row business transactions, DDL, DELETE, INSERT, UPSERT, or cross-database atomicity in v0.1.
64
+
65
+ ## Required Operator Controls
66
+
67
+ - Use a read-only credential for MCP reads.
68
+ - Use a separate write credential only in the trusted runner environment.
69
+ - Scope runner tokens to the project/source they serve.
70
+ - Keep capability config under code review.
71
+ - Prefer version/timestamp conflict guards over weak row-hash fallback.
72
+ - Review proposal diffs and evidence before approval.
73
+ - Monitor conflict/failed receipt rates.
74
+
75
+ ## Release Blockers
76
+
77
+ - Client-specific MCP configuration must be tested before claiming support for that client.
78
+ - Cloud-linked mode requires a compatible Synapsor Cloud API and scoped runner token.
79
+ - Public release should include dependency review, secret scanning, and container-backed smoke results.
package/dist/runner.mjs CHANGED
@@ -8439,7 +8439,7 @@ function stringOrDefault(value, fallback) {
8439
8439
  // apps/runner/package.json
8440
8440
  var package_default = {
8441
8441
  name: "@synapsor/runner",
8442
- version: "0.1.12",
8442
+ version: "0.1.14",
8443
8443
  description: "Stop giving AI agents execute_sql; expose reviewed Postgres/MySQL MCP actions with proposals, approval, writeback, and replay.",
8444
8444
  license: "Apache-2.0",
8445
8445
  type: "module",
@@ -8470,9 +8470,12 @@ var package_default = {
8470
8470
  "schemas/**",
8471
8471
  "recipes/**/*.json",
8472
8472
  "README.md",
8473
+ "AGENTS.md",
8473
8474
  "CHANGELOG.md",
8475
+ "CONTRIBUTING.md",
8474
8476
  "LICENSE",
8475
8477
  "NOTICE",
8478
+ "THREAT_MODEL.md",
8476
8479
  "TRADEMARKS.md"
8477
8480
  ],
8478
8481
  keywords: [
package/docs/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Synapsor Runner Docs
2
2
 
3
3
  Start with the README. Use this index when you need the task-specific next
4
- step. The order is intentional: run something first, wire your database second,
5
- then read the concepts once the safety boundary is visible.
4
+ step. The order is intentional: audit the model-facing risk first, run the
5
+ no-database demo, wire your database, then read deeper concepts.
6
6
 
7
7
  ## 01 Quickstart
8
8
 
9
- - [README](../README.md): wedge, no-DB quick demo, five-line model, and the
10
- shortest own-database path.
9
+ - [README](../README.md): audit-first proof, no-database demo, safety diagram,
10
+ and the shortest own-database path.
11
11
  - [Troubleshooting First Run](troubleshooting-first-run.md): common first-run
12
12
  failures, redacted diagnostics, and fixes.
13
13
 
@@ -98,6 +98,8 @@ then read the concepts once the safety boundary is visible.
98
98
  scope, database roles, receipt grants, local ledger backup, restart behavior,
99
99
  Docker/systemd shapes, TLS, and release-gate expectations.
100
100
  - [Cloud Mode](cloud-mode.md): what stays local and what Cloud-linked mode adds.
101
+ - [OSS Runner Vs Synapsor Cloud](oss-vs-cloud.md): detailed product and
102
+ operational boundary.
101
103
  - [Cloud Push](cloud-push.md): register a validated local contract in the
102
104
  versioned Cloud registry.
103
105
  - [Runner Bundles](runner-bundles.md): download the same immutable contract and
@@ -116,3 +118,26 @@ then read the concepts once the safety boundary is visible.
116
118
  The public docs intentionally stay task-first. Historical implementation
117
119
  reports, release checklists, and internal planning notes are not part of the
118
120
  getting-started path.
121
+
122
+ ## Core Terms
123
+
124
+ - Capability: a reviewed model-facing business tool such as
125
+ `billing.inspect_invoice` or `billing.propose_late_fee_waiver`.
126
+ - Proposal: an exact suggested change saved without mutating the source
127
+ database.
128
+ - Writeback: execution of an approved proposal outside the model-facing MCP
129
+ surface.
130
+ - Executor: Runner's guarded one-row updater or an app-owned handler for richer
131
+ approved business transactions.
132
+
133
+ ## Repository Map
134
+
135
+ - `apps/runner`: CLI, local review UI, and packaged npm documentation.
136
+ - `packages/spec`: canonical contract schemas and conformance fixtures.
137
+ - `packages/dsl`: SQL-like contract authoring.
138
+ - `packages/mcp-server`: stdio and HTTP MCP runtime.
139
+ - `packages/proposal-store`: local evidence, proposal, receipt, and replay
140
+ ledger.
141
+ - `packages/postgres`, `packages/mysql`: guarded writeback adapters.
142
+ - `examples`: disposable demos and client integrations.
143
+ - `docs`: task guides, security boundaries, operations, and release policy.
@@ -78,20 +78,11 @@ that is not a Postgres permission issue. It means the client reached the
78
78
  database, but your local Node/Postgres TLS stack could not verify the server's
79
79
  certificate chain.
80
80
 
81
- For disposable dev RDS fixtures, you can allow an insecure retry:
82
-
83
- ```bash
84
- ./scripts/use-your-db.sh --allow-insecure-ssl
85
- ```
86
-
87
- or put `sslmode=no-verify` in the disposable test URL.
88
-
89
- For real staging or production-like testing, do not disable verification.
90
- Install/use the AWS RDS CA bundle and keep certificate verification enabled.
91
- For example, download the AWS RDS global bundle and configure your Postgres URL
92
- or client environment so the Node Postgres client trusts that CA. The exact
93
- mechanism depends on your deployment environment and should be treated like any
94
- other trusted database TLS setup.
81
+ Do not disable certificate verification. Install the managed database CA bundle
82
+ and configure the Postgres/MySQL client environment to trust it. For AWS RDS,
83
+ use the current AWS RDS regional or global CA bundle. Treat database CA
84
+ configuration like any other production trust-store dependency and verify it
85
+ before using staging or production-like data.
95
86
 
96
87
  ## 2. Inspect metadata
97
88
 
package/docs/mcp-audit.md CHANGED
@@ -150,3 +150,29 @@ A safer model-facing database MCP tool should look like a reviewed semantic prop
150
150
  ```
151
151
 
152
152
  Trusted values such as tenant, principal, source, allowed columns, approval identity, row-version guard, and database credentials must come from Synapsor/runner context, not from model-facing arguments.
153
+
154
+ ## Related Fixture Benchmark
155
+
156
+ `synapsor-runner benchmark mcp-efficiency` compares a fixed generic database
157
+ MCP shape with the semantic late-fee-waiver path used by Runner. The checked-in
158
+ fixture currently demonstrates:
159
+
160
+ ```text
161
+ Generic database MCP reference:
162
+ exposed tools: 4
163
+ scripted tool calls: 5
164
+ raw SQL exposed: yes
165
+ approval separated: no
166
+ stale-row conflict checked: no
167
+
168
+ Synapsor Runner semantic path:
169
+ exposed tools: 2
170
+ scripted tool calls: 2
171
+ raw SQL exposed: no
172
+ approval separated: yes
173
+ stale-row conflict checked: yes
174
+ ```
175
+
176
+ The fixture tokenizer is deterministic and repeatable for this repository. It
177
+ is not a model billing tokenizer and does not support a universal token-savings
178
+ claim.
@@ -0,0 +1,50 @@
1
+ # OSS Runner Vs Synapsor Cloud
2
+
3
+ Synapsor Runner and Synapsor Cloud share the canonical `@synapsor/spec`
4
+ contract, but they solve different operational problems.
5
+
6
+ Runner is the open-source runtime that stays next to your application and
7
+ database. It serves reviewed MCP tools, binds trusted context, stores local
8
+ evidence and proposals, keeps approval outside MCP, applies or routes approved
9
+ writeback, and records receipts and replay in a local SQLite ledger.
10
+
11
+ Cloud is the team control plane. It stores versioned contracts, produces
12
+ downloadable Runner bundles, and provides shared activity, evidence, approval,
13
+ and investigation surfaces for enabled design-partner deployments.
14
+
15
+ | Need | OSS Runner | Synapsor Cloud |
16
+ | --- | --- | --- |
17
+ | MCP runtime | Local stdio or Streamable HTTP server | Contracts export to local Runner bundles; managed runner fleet is future work |
18
+ | Contract source | Local files reviewed in Git | Shared registry with immutable versions and digests |
19
+ | Trusted context | Local environment/session bindings | Registered bindings plus deployment-specific Cloud session context |
20
+ | Capabilities | Local semantic MCP tools | Registry, version history, and capability inspection |
21
+ | Evidence and replay | Local SQLite ledger | Shared activity and evidence surfaces where enabled |
22
+ | Approval | Local CLI or localhost UI | Team approval surfaces where enabled |
23
+ | Writeback | Guarded one-row update or app-owned executor | Cloud-linked jobs with local execution; managed production orchestration is future work |
24
+ | MCP risk audit | Static local audit | Organization-wide continuous audit is future work |
25
+ | Identity | Local operator boundary | Workspace RBAC where configured; SAML and SCIM are future work |
26
+ | Operations | Customer-operated single node | Design-partner operation; no enterprise SLA in the current beta |
27
+
28
+ ## What Stays Local
29
+
30
+ - database read and write credentials;
31
+ - trusted application handler credentials;
32
+ - direct access to Postgres or MySQL;
33
+ - the process that executes guarded writeback;
34
+ - local development ledgers when Cloud linkage is not enabled.
35
+
36
+ Cloud contract registration does not require uploading database credentials or
37
+ business rows. A Runner bundle contains the normalized contract, placeholder
38
+ environment-variable wiring, and MCP client templates.
39
+
40
+ ## Adoption Path
41
+
42
+ 1. Run the OSS audit and quick demo without an account.
43
+ 2. Connect Runner to a staging database and review the model-facing tools.
44
+ 3. Keep contracts in Git and exercise proposal, approval, writeback, and replay.
45
+ 4. Push the validated contract when the team needs a shared registry and review
46
+ surface.
47
+
48
+ See [Cloud Push](cloud-push.md), [Runner Bundles](runner-bundles.md), and
49
+ [Cloud Mode](cloud-mode.md) for commands and deployment details. See
50
+ [Current Limitations](limitations.md) for the runtime boundary.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synapsor/runner",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Stop giving AI agents execute_sql; expose reviewed Postgres/MySQL MCP actions with proposals, approval, writeback, and replay.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -31,9 +31,12 @@
31
31
  "schemas/**",
32
32
  "recipes/**/*.json",
33
33
  "README.md",
34
+ "AGENTS.md",
34
35
  "CHANGELOG.md",
36
+ "CONTRIBUTING.md",
35
37
  "LICENSE",
36
38
  "NOTICE",
39
+ "THREAT_MODEL.md",
37
40
  "TRADEMARKS.md"
38
41
  ],
39
42
  "keywords": [