@synapsor/runner 1.6.3 → 1.6.5
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/AGENTS.md +2 -2
- package/CHANGELOG.md +94 -8
- package/CONTRIBUTING.md +10 -3
- package/README.md +90 -109
- package/SECURITY.md +7 -3
- package/THREAT_MODEL.md +37 -0
- package/dist/authoring.mjs +98 -13
- package/dist/cli.d.ts +12 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/local-ui.d.ts +60 -0
- package/dist/local-ui.d.ts.map +1 -1
- package/dist/runner.mjs +7688 -2227
- package/dist/runtime.mjs +528 -51
- package/docs/README.md +14 -0
- package/docs/agent-guided-setup.md +13 -11
- package/docs/aggregate-reads.md +14 -5
- package/docs/app-owned-executors.md +5 -6
- package/docs/auto-boundary-and-scoped-explore.md +70 -14
- package/docs/capability-authoring.md +2 -2
- package/docs/client-recipes.md +41 -12
- package/docs/cloud-mode.md +7 -7
- package/docs/conformance.md +6 -3
- package/docs/current-scope.md +13 -2
- package/docs/cursor-plugin.md +3 -3
- package/docs/database-enforced-scope.md +6 -0
- package/docs/dsl-reference.md +12 -1
- package/docs/fresh-developer-usability.md +6 -6
- package/docs/getting-started-own-database.md +52 -50
- package/docs/guided-onboarding.md +104 -34
- package/docs/host-compatibility.md +24 -11
- package/docs/limitations.md +34 -14
- package/docs/local-mode.md +20 -20
- package/docs/mcp-audit.md +14 -14
- package/docs/mcp-client-setup.md +26 -14
- package/docs/mcp-clients.md +47 -11
- package/docs/migrating-to-synapsor-spec.md +5 -1
- package/docs/openai-agents-sdk.md +2 -2
- package/docs/proposal-evidence-freshness.md +7 -7
- package/docs/recipes.md +6 -6
- package/docs/release-notes.md +100 -10
- package/docs/release-policy.md +20 -7
- package/docs/reversible-change-sets.md +1 -1
- package/docs/reviewed-database-views.md +132 -0
- package/docs/reviewed-relationships.md +245 -0
- package/docs/rfcs/006-reviewed-reversible-change-sets.md +1 -1
- package/docs/runner-bundles.md +7 -7
- package/docs/schema-api-candidates.md +1 -1
- package/docs/security-boundary.md +30 -0
- package/docs/troubleshooting-first-run.md +63 -19
- package/docs/use-your-own-database.md +6 -4
- package/docs/workbench-ask.md +279 -0
- package/docs/writeback-executors.md +7 -7
- package/examples/auto-boundary-churn/README.md +1 -1
- package/examples/community-solar-clean-room/README.md +7 -0
- package/examples/community-solar-clean-room/docker-compose.yml +16 -0
- package/examples/community-solar-clean-room/package.json +15 -0
- package/examples/community-solar-clean-room/prisma/schema.prisma +171 -0
- package/examples/community-solar-clean-room/seed/postgres.sql +571 -0
- package/examples/fitflow-guided-onboarding/README.md +2 -2
- package/examples/openai-agents-http/Makefile +1 -1
- package/examples/openai-agents-http/README.md +1 -1
- package/examples/openai-agents-stdio/Makefile +1 -1
- package/examples/openai-agents-stdio/README.md +2 -2
- package/examples/openai-agents-stdio/agent.py +1 -4
- package/examples/reference-support-billing-app/README.md +16 -16
- package/examples/retail-clean-room/README.md +7 -0
- package/examples/retail-clean-room/docker-compose.yml +16 -0
- package/examples/retail-clean-room/package.json +9 -0
- package/examples/retail-clean-room/prisma/schema.prisma +239 -0
- package/examples/retail-clean-room/seed/postgres.sql +781 -0
- package/examples/retail-clean-room/view-recipe/average-retained-revenue.synapsor.sql +21 -0
- package/examples/retail-clean-room/view-recipe/synapsor.runner.json +25 -0
- package/examples/support-plan-credit/mcp-client-examples/claude-code.sh +1 -4
- package/examples/support-plan-credit/mcp-client-examples/claude-desktop.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/codex.config.toml +1 -4
- package/examples/support-plan-credit/mcp-client-examples/cursor-global.mcp.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/cursor-project.mcp.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/generic-stdio.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/generic-stdio.mjs +1 -1
- package/examples/support-plan-credit/mcp-client-examples/google-adk.py +1 -1
- package/examples/support-plan-credit/mcp-client-examples/langchain.mjs +1 -1
- package/examples/support-plan-credit/mcp-client-examples/llamaindex.py +1 -1
- package/examples/support-plan-credit/mcp-client-examples/openai-agents-stdio.ts +1 -1
- package/examples/support-plan-credit/mcp-client-examples/vscode.mcp.json +1 -4
- package/fixtures/compatibility/published-1.6.3/manifest.json +76 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/llms.txt +10 -5
- package/package.json +9 -2
package/AGENTS.md
CHANGED
|
@@ -10,8 +10,8 @@ writeback, and local evidence/replay.
|
|
|
10
10
|
Use the stable package for public/user-facing examples:
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npx -y
|
|
14
|
-
npx -y
|
|
13
|
+
npx -y @synapsor/runner demo --quick
|
|
14
|
+
npx -y @synapsor/runner audit --example dangerous-db-mcp
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Use the local checkout while editing this repo:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,94 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 1.6.
|
|
3
|
+
## 1.6.5 (prepared, not published)
|
|
4
|
+
|
|
5
|
+
### Managed Claude Code and VS Code project MCP installs
|
|
6
|
+
|
|
7
|
+
- Extends Runner's reviewed project MCP lifecycle from Cursor to Claude Code
|
|
8
|
+
and VS Code. `mcp install`, `mcp status`, and `mcp uninstall` now manage only
|
|
9
|
+
Runner's project-local entry in `.mcp.json` or `.vscode/mcp.json`.
|
|
10
|
+
- Preserves unrelated servers and settings, creates backups, pins the exact
|
|
11
|
+
Runner package version, tracks ownership with an integrity marker, refuses
|
|
12
|
+
tampered or unowned entries, and keeps credentials and trusted scope out of
|
|
13
|
+
client configuration.
|
|
14
|
+
- Preserves VS Code JSONC comments and trailing commas. Static status and a
|
|
15
|
+
real optional stdio `tools/list` launch check prove that each client receives
|
|
16
|
+
the same reviewed model-facing authority.
|
|
17
|
+
- Makes onboarding, Workbench guidance, README positioning, host recipes, and
|
|
18
|
+
`doctor` client-neutral while retaining the existing Cursor lifecycle and
|
|
19
|
+
`--check-cursor` compatibility.
|
|
20
|
+
|
|
21
|
+
Prepared package versions: `@synapsor/runner@1.6.5` and the optional
|
|
22
|
+
`synapsor-runner@1.6.5` command alias. `@synapsor/spec@1.7.0` and
|
|
23
|
+
`@synapsor/dsl@1.7.0` are unchanged. No package is published by this change.
|
|
24
|
+
|
|
25
|
+
## 1.6.4 (published 2026-07-25)
|
|
26
|
+
|
|
27
|
+
### Review-correct onboarding and reviewed relationship paths
|
|
28
|
+
|
|
29
|
+
- Repairs generated-boundary review state so edits invalidate only dependent
|
|
30
|
+
confirmations, stale browser revisions fail compare-and-swap checks, and
|
|
31
|
+
unrelated reviewed decisions survive. Secure headless activation now uses the
|
|
32
|
+
same exact-digest/operator boundary as Workbench.
|
|
33
|
+
- Reworks the first Workbench experience around a small starter resource pack,
|
|
34
|
+
clearer plain-language authority and source-change status, stable
|
|
35
|
+
progressive disclosure, managed identity/scope decisions, and one primary
|
|
36
|
+
next action. Nested-project config discovery and resume behavior no longer
|
|
37
|
+
force a developer to rediscover paths or restart review.
|
|
38
|
+
- Adds a no-argument first-run path that accepts the database URL through a
|
|
39
|
+
hidden terminal prompt or explicitly confirmed, key-specific environment-file
|
|
40
|
+
discovery. A conservative local-development fast lane reaches a real safe
|
|
41
|
+
read with at most two plain questions and one recorded exact-digest human
|
|
42
|
+
gesture, without exporting the URL or editing generated files.
|
|
43
|
+
- Tightens deterministic sensitive-field classification across unfamiliar
|
|
44
|
+
schemas and combines database, Prisma, Drizzle, OpenAPI, and existing
|
|
45
|
+
Synapsor evidence without an LLM. Ambiguous identity/scope and high-risk
|
|
46
|
+
fields stay blocked or kept out for human review.
|
|
47
|
+
- Adds public, additive reviewed relationship paths for protected aggregate
|
|
48
|
+
reads: up to three activated paths, each containing one or two
|
|
49
|
+
catalog-proven many-to-one links with fan-out one. The model may reference an
|
|
50
|
+
active path by name but cannot supply identifiers, join semantics, or
|
|
51
|
+
activation.
|
|
52
|
+
- Adds demand-driven relationship review. A plan requiring an inactive proven
|
|
53
|
+
path fails closed, Workbench stages that exact proof for an operator, nullable
|
|
54
|
+
links require an explicit `EXCLUDE` or `KEEP NULL` choice, and a new digest is
|
|
55
|
+
required before retry.
|
|
56
|
+
- Enforces trusted tenant/principal scope on every participating relation,
|
|
57
|
+
suppression after final grouping, generation-lock/catalog-proof drift, and
|
|
58
|
+
permanent rejection of one-to-many, many-to-many, ambiguous-cardinality,
|
|
59
|
+
over-depth, and model-improvised joins. Complex formulas and relationship
|
|
60
|
+
graphs remain on reviewed database views.
|
|
61
|
+
- Adds clean-room Community Solar and Retail onboarding/PM-analysis journeys,
|
|
62
|
+
plus live PostgreSQL/MySQL star/depth-two, nullable-link, drift, privacy, and
|
|
63
|
+
deliberately wrong fan-out tests. Published `1.6.3` contracts, digests,
|
|
64
|
+
startup routes, and tool surfaces remain byte-compatible unless the new
|
|
65
|
+
feature is explicitly adopted.
|
|
66
|
+
- Adds optional local Workbench Ask over the exact reviewed MCP/runtime tool
|
|
67
|
+
surface. OpenAI, Anthropic, and custom OpenAI-compatible adapters use
|
|
68
|
+
digest-bound direct-egress consent, in-memory credentials/history, fixed
|
|
69
|
+
size/time/tool/token bounds, escaped model output, and proposal-only writes;
|
|
70
|
+
the no-model composer remains complete and enabled by default.
|
|
71
|
+
- Hardens provider endpoints with fixed official origins, remote HTTPS,
|
|
72
|
+
loopback-only plaintext, redirect refusal, per-connection DNS validation and
|
|
73
|
+
address pinning, private/special destination refusal, and redacted failures.
|
|
74
|
+
The pinned lookup supports Node 22's multi-address callback shape.
|
|
75
|
+
- Extends both packed clean-room labs through the actual Ask UI. Retail visibly
|
|
76
|
+
refuses a kept-out customer-note aggregate, and Community Solar proves a
|
|
77
|
+
proposal cannot commit. An owner-authorized live OpenAI `gpt-5-mini` run
|
|
78
|
+
matched official MCP results and passed exact-key artifact/browser scans;
|
|
79
|
+
Anthropic and generic compatible claims remain protocol-scoped.
|
|
80
|
+
- Uses direct `npx` only for first acquisition and the installed
|
|
81
|
+
`synapsor-runner` binary afterward. The optional unscoped command package is a
|
|
82
|
+
version-locked delegate with no independent runtime or authority logic;
|
|
83
|
+
explicit pinned and automation invocations remain compatible.
|
|
84
|
+
- Adds one local, escaped, copy-exact DSL syntax highlighter for every
|
|
85
|
+
Workbench DSL preview, with no CDN or unsafe HTML path, and gives activity,
|
|
86
|
+
review, and apply detail the full available width on desktop and mobile.
|
|
87
|
+
- Published `@synapsor/runner@1.6.4`, `@synapsor/spec@1.7.0`,
|
|
88
|
+
`@synapsor/dsl@1.7.0`, and the optional `synapsor-runner@1.6.4` command
|
|
89
|
+
alias.
|
|
90
|
+
|
|
91
|
+
## 1.6.3 (published 2026-07-24)
|
|
4
92
|
|
|
5
93
|
### Guided adoption without weaker authority
|
|
6
94
|
|
|
@@ -67,13 +155,11 @@
|
|
|
67
155
|
additive behavior is staged as `@synapsor/spec@1.6.0` and
|
|
68
156
|
`@synapsor/dsl@1.6.0`; legacy contracts retain their exact normalization and
|
|
69
157
|
digests.
|
|
70
|
-
-
|
|
71
|
-
`@synapsor/dsl@1.6.0`.
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Spec. This preserves the required Spec-first release order without masking a
|
|
76
|
-
broken packed Runner manifest.
|
|
158
|
+
- Published `@synapsor/runner@1.6.3`, `@synapsor/spec@1.6.0`, and
|
|
159
|
+
`@synapsor/dsl@1.6.0`.
|
|
160
|
+
- The clean Runner tarball gate used the locally packed public Spec before the
|
|
161
|
+
coordinated release, then returned to the stronger registry-only
|
|
162
|
+
dependency-resolution proof once npm had that exact Spec.
|
|
77
163
|
|
|
78
164
|
## 1.6.2 (published 2026-07-23)
|
|
79
165
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -15,8 +15,10 @@ Please do not submit pull requests or code patches unless the maintainers have
|
|
|
15
15
|
explicitly requested them under an approved contribution process.
|
|
16
16
|
|
|
17
17
|
For maintainers, use small changes with tests. Do not add support for arbitrary
|
|
18
|
-
SQL, multi-row
|
|
19
|
-
statements.
|
|
18
|
+
SQL, model-generated or unbounded multi-row predicates, DDL, stored procedures,
|
|
19
|
+
or model-generated write statements. Existing bounded-set support must retain
|
|
20
|
+
its reviewer-fixed predicate, hard row/value caps, atomic execution, frozen
|
|
21
|
+
members, and exact receipts.
|
|
20
22
|
|
|
21
23
|
Before opening a change:
|
|
22
24
|
|
|
@@ -36,10 +38,15 @@ idempotency, replay, MCP tool exposure, or app-owned handlers must prove:
|
|
|
36
38
|
|
|
37
39
|
- no model-facing `execute_sql`, raw SQL, approval, commit, apply, or writeback
|
|
38
40
|
tool was added;
|
|
39
|
-
- tenant/
|
|
41
|
+
- tenant/principal values come from trusted context, not model-controlled args;
|
|
40
42
|
- direct writeback still checks primary key, tenant key, allowed columns,
|
|
41
43
|
expected version/conflict guard, affected-row count, idempotency, and receipt
|
|
42
44
|
recording;
|
|
45
|
+
- generated authority remains disabled until exact-digest human activation,
|
|
46
|
+
Scoped Explore remains local authoring-only, and reviewed relationship paths
|
|
47
|
+
cannot be supplied or activated by the model;
|
|
48
|
+
- proposal/evidence freshness and supervised worker apply continue to fail
|
|
49
|
+
closed on source, digest, scope, policy, limit, or role-posture drift;
|
|
43
50
|
- app-owned handler templates tell developers to re-check tenant/scope,
|
|
44
51
|
expected version, idempotency, allowed action, transaction/rollback, and
|
|
45
52
|
receipt shape.
|
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
**MCP connects the agent. Synapsor controls the commit.**
|
|
10
10
|
|
|
11
|
-
Synapsor Runner is an open-source MCP runtime for Postgres and MySQL. It
|
|
12
|
-
agents
|
|
13
|
-
|
|
14
|
-
model-facing surface.
|
|
11
|
+
Synapsor Runner is an open-source MCP runtime for Postgres and MySQL. It lets
|
|
12
|
+
agents ask bounded business questions of reviewed data and propose exact Data
|
|
13
|
+
PRs, while keeping credentials, activation, approval, and commit authority
|
|
14
|
+
outside the model-facing surface.
|
|
15
15
|
|
|
16
16
|
## Prove The Boundary In Four Seconds
|
|
17
17
|
|
|
@@ -21,9 +21,8 @@ No database, Docker, config, MCP client, LLM, or account is required:
|
|
|
21
21
|
npx -y @synapsor/runner try --prove
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
The embedded synthetic source requests a $55 waiver and proves:
|
|
24
|
+
Cold `npx` download time is excluded. The embedded source requests a $55
|
|
25
|
+
waiver and proves:
|
|
27
26
|
|
|
28
27
|
```text
|
|
29
28
|
Proposed effect: late_fee_cents: 5500 -> 0
|
|
@@ -33,9 +32,8 @@ Restart-safe retry: yes; duplicate mutations: 0
|
|
|
33
32
|
Stale apply refused: yes
|
|
34
33
|
```
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`demo --quick` remains a noninteractive compatibility alias.
|
|
35
|
+
State stays under `./.synapsor/try/`. This proves the boundary, not your
|
|
36
|
+
database connection; `demo --quick` remains a noninteractive compatibility alias.
|
|
39
37
|
|
|
40
38
|
## Audit An Existing MCP Server
|
|
41
39
|
|
|
@@ -45,52 +43,64 @@ Audit a typical raw-SQL MCP server without launching or calling one:
|
|
|
45
43
|
npx -y @synapsor/runner audit --example dangerous-db-mcp
|
|
46
44
|
```
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
Or audit your own manifest, remote `tools/list`, or stdio server:
|
|
49
47
|
|
|
50
48
|
```bash
|
|
51
49
|
npx -y @synapsor/runner audit ./tools-list.json
|
|
52
50
|
```
|
|
53
51
|
|
|
54
52
|
It flags raw SQL, arbitrary identifiers, model-controlled authority, and
|
|
55
|
-
model-facing writeback without calling business tools. See [MCP
|
|
56
|
-
Review](docs/mcp-audit.md) and the [alternatives
|
|
57
|
-
guide](docs/alternatives.md).
|
|
53
|
+
model-facing writeback without calling business tools. See [MCP Audit](docs/mcp-audit.md).
|
|
58
54
|
|
|
59
55
|
## Connect Your Staging Application
|
|
60
56
|
|
|
61
|
-
Use a
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
Use a SELECT-only, non-owner development or staging credential. Runner combines
|
|
58
|
+
database metadata with statically parsed Prisma, Drizzle, OpenAPI, and existing
|
|
59
|
+
Synapsor definitions without executing adopter code, sampling rows, or using an
|
|
60
|
+
LLM:
|
|
65
61
|
|
|
66
62
|
```bash
|
|
67
|
-
|
|
68
|
-
export SYNAPSOR_TENANT_ID="acme"
|
|
69
|
-
export SYNAPSOR_PRINCIPAL="developer-1"
|
|
70
|
-
npx -y @synapsor/runner@latest start --from-env DATABASE_URL
|
|
63
|
+
npx -y @synapsor/runner start
|
|
71
64
|
```
|
|
72
65
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
Paste the URL into the hidden prompt, approve a regular project `.env` for this
|
|
67
|
+
process, or export `DATABASE_URL`. Runner creates a validated zero-authority
|
|
68
|
+
project and opens secured localhost Workbench. A personal-development fast lane
|
|
69
|
+
offers one conservative resource with sensitive fields, relationships, and
|
|
70
|
+
writes off; broader paths require full review.
|
|
77
71
|
|
|
78
72
|
[Database To First Safe Tool](docs/guided-onboarding.md) covers the complete
|
|
79
73
|
path.
|
|
80
74
|
|
|
81
|
-
## Ask Your First Real Question
|
|
75
|
+
## Ask Your First Real Question
|
|
76
|
+
|
|
77
|
+
Runner is host-neutral. These three paths execute the same typed plans against
|
|
78
|
+
the same activated digest, trusted scope, suppression rules, budgets, and
|
|
79
|
+
denials:
|
|
82
80
|
|
|
83
|
-
|
|
81
|
+
1. **Workbench composer:** no MCP client, model, or API key. Choose only reviewed
|
|
82
|
+
measures, dimensions, filters, and time buckets.
|
|
83
|
+
2. **Workbench Ask:** optional OpenAI, Anthropic, or loopback
|
|
84
|
+
OpenAI-compatible model after explicit digest-bound egress consent. Keys and
|
|
85
|
+
conversation history remain in memory; a loopback model keeps data local.
|
|
86
|
+
3. **Any MCP client:** use a managed project installer for Cursor, Claude Code,
|
|
87
|
+
or VS Code, or a checked recipe for Claude Desktop, Codex, OpenAI Agents,
|
|
88
|
+
LangChain/LangGraph, Google ADK, LlamaIndex, and generic stdio.
|
|
89
|
+
|
|
90
|
+
For a managed project, choose one:
|
|
84
91
|
|
|
85
92
|
```bash
|
|
86
|
-
synapsor-runner mcp install cursor
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
--project-root . \
|
|
90
|
-
--yes
|
|
93
|
+
synapsor-runner mcp install cursor --project --authoring --project-root . --yes
|
|
94
|
+
synapsor-runner mcp install claude-code --project --authoring --project-root . --yes
|
|
95
|
+
synapsor-runner mcp install vscode --project --authoring --project-root . --yes
|
|
91
96
|
```
|
|
92
97
|
|
|
93
|
-
|
|
98
|
+
Runner merges only its `synapsor` entry into `.cursor/mcp.json`, `.mcp.json`, or
|
|
99
|
+
`.vscode/mcp.json`; it preserves other settings, backs up existing files, pins
|
|
100
|
+
the exact Runner version, and writes no credentials. See
|
|
101
|
+
[Client And Framework Recipes](docs/client-recipes.md).
|
|
102
|
+
|
|
103
|
+
The selected client sees exactly two temporary tools:
|
|
94
104
|
|
|
95
105
|
```text
|
|
96
106
|
app.describe_data
|
|
@@ -104,35 +114,36 @@ Which reviewed regions and reason categories contributed most to the increase
|
|
|
104
114
|
in churned accounts by week?
|
|
105
115
|
```
|
|
106
116
|
|
|
107
|
-
Runner validates a typed plan against the
|
|
108
|
-
|
|
109
|
-
|
|
117
|
+
Runner validates a typed plan against the active digest, injects trusted scope,
|
|
118
|
+
and runs read-only. Suppression and durable budgets limit extraction. Up to
|
|
119
|
+
three activated one- or two-link many-to-one paths are supported; inactive or
|
|
120
|
+
unsafe joins fail closed. This is descriptive analysis, not causation. See
|
|
121
|
+
[Reviewed Relationships](docs/reviewed-relationships.md).
|
|
110
122
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
123
|
+
This is bounded, governed analytics over reviewed measures, dimensions, time
|
|
124
|
+
grains, and relationship paths, not a general BI dashboard or SQL surface.
|
|
125
|
+
Protect turns a useful analysis into a named, digest-reviewed metric capability.
|
|
126
|
+
See [Workbench Ask](docs/workbench-ask.md).
|
|
114
127
|
|
|
115
128
|
## Protect This Query
|
|
116
129
|
|
|
117
|
-
Choose
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
exact-digest human activation outside MCP.
|
|
130
|
+
Choose a useful result without copying an ID. Runner freezes public DSL,
|
|
131
|
+
canonical JSON, and tests under `synapsor/protected/drafts/`; the named
|
|
132
|
+
capability starts disabled.
|
|
121
133
|
|
|
122
|
-
After activation, Scoped Explore is disabled. Update
|
|
123
|
-
config:
|
|
134
|
+
After activation, Scoped Explore is disabled. Update the selected project
|
|
135
|
+
client to the production config:
|
|
124
136
|
|
|
125
137
|
```bash
|
|
126
|
-
|
|
127
|
-
|
|
138
|
+
CLIENT=claude-code # or cursor / vscode
|
|
139
|
+
synapsor-runner mcp install "$CLIENT" --project \
|
|
128
140
|
--config ./synapsor.runner.json \
|
|
129
141
|
--store ./.synapsor/local.db \
|
|
130
142
|
--yes
|
|
131
143
|
```
|
|
132
144
|
|
|
133
|
-
Production exposes the
|
|
134
|
-
|
|
135
|
-
guide](docs/auto-boundary-and-scoped-explore.md).
|
|
145
|
+
Production exposes the activated named capability, never `app.explore_data`.
|
|
146
|
+
See [Explore And Protect](docs/auto-boundary-and-scoped-explore.md).
|
|
136
147
|
|
|
137
148
|
## Create An Exact Data PR
|
|
138
149
|
|
|
@@ -156,24 +167,17 @@ Effect plan_credit_cents: 0 -> 2500
|
|
|
156
167
|
Source unchanged before approval: Yes
|
|
157
168
|
```
|
|
158
169
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
Runner rechecks scope, policy, row version, bounds, idempotency, and affected
|
|
165
|
-
rows before returning a receipt. A retry cannot duplicate the mutation and a
|
|
166
|
-
stale proposal conflicts. Inspect the latest lifecycle without copying an ID:
|
|
170
|
+
Approval stays outside MCP. A trusted operator or worker rechecks scope,
|
|
171
|
+
freshness, policy, version, bounds, idempotency, and affected rows before a
|
|
172
|
+
receipt. Runner supports guarded single-row CRUD and bounded reviewed sets;
|
|
173
|
+
rich transactions use app-owned executors. Inspect without copying an ID:
|
|
167
174
|
|
|
168
175
|
```bash
|
|
169
176
|
synapsor-runner lifecycle --details --store ./.synapsor/local.db
|
|
170
177
|
```
|
|
171
178
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
approval. Apply rechecks those declared same-database dependencies again inside
|
|
175
|
-
the write transaction; stale evidence produces zero mutation and requires a new
|
|
176
|
-
proposal:
|
|
179
|
+
Optional same-database evidence freshness is checked before approval and again
|
|
180
|
+
inside direct-SQL apply; drift produces zero mutation:
|
|
177
181
|
|
|
178
182
|
```bash
|
|
179
183
|
synapsor-runner proposals check-freshness latest \
|
|
@@ -181,12 +185,8 @@ synapsor-runner proposals check-freshness latest \
|
|
|
181
185
|
--store ./.synapsor/local.db
|
|
182
186
|
```
|
|
183
187
|
|
|
184
|
-
See
|
|
185
|
-
|
|
186
|
-
[store lifecycle](docs/store-lifecycle.md). For production identity, follow
|
|
187
|
-
`APPROVAL ROLE` through verified OIDC/signed-key approval and a separate apply
|
|
188
|
-
role in [Approval Roles And Verified Operator
|
|
189
|
-
Identity](docs/approval-roles-and-operator-identity.md).
|
|
188
|
+
See [Proposal Freshness](docs/proposal-evidence-freshness.md) and [Verified
|
|
189
|
+
Operator Identity](docs/approval-roles-and-operator-identity.md).
|
|
190
190
|
|
|
191
191
|
## Safety Model
|
|
192
192
|
|
|
@@ -194,7 +194,8 @@ Contracts fix trusted context, fields, bounds, transitions, and approval.
|
|
|
194
194
|
Model-facing tools can inspect scoped data and propose exact changes, but cannot
|
|
195
195
|
approve, apply, or revert. A trusted operator/worker performs guarded writeback;
|
|
196
196
|
the ledger links evidence, proposal, decision, receipt, and replay. Runner does
|
|
197
|
-
not make raw SQL or prompt-injection-prone clients safe.
|
|
197
|
+
not make raw SQL or prompt-injection-prone clients safe. Compare the boundary
|
|
198
|
+
with [prompt and application guardrails](docs/why-synapsor-vs-app-guardrails.md).
|
|
198
199
|
|
|
199
200
|
## Choose An Isolation Mode
|
|
200
201
|
|
|
@@ -205,13 +206,10 @@ not make raw SQL or prompt-injection-prone clients safe.
|
|
|
205
206
|
| `postgres_rls` | PostgreSQL also checks transaction-bound tenant/principal scope. Arbitrary trusted-context or credential control remains outside this guarantee. |
|
|
206
207
|
| `tenant_bound` | Authenticated context selects a restricted per-tenant credential or process. |
|
|
207
208
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
MySQL has no native RLS; use restricted views or tenant credentials. See
|
|
213
|
-
[Database scope] and the
|
|
214
|
-
[build-vs-adopt guide](docs/why-synapsor-vs-app-guardrails.md).
|
|
209
|
+
Stdio opens no socket. HTTP requires authentication; remote listeners require
|
|
210
|
+
TLS or a trusted TLS proxy, and shared services require signed claims. MySQL has
|
|
211
|
+
no native RLS; use restricted views or tenant credentials. See [HTTP MCP] and
|
|
212
|
+
[Database scope].
|
|
215
213
|
|
|
216
214
|
## Review And Prove Your Contract
|
|
217
215
|
|
|
@@ -222,49 +220,30 @@ and the [own-database guide](docs/getting-started-own-database.md).
|
|
|
222
220
|
|
|
223
221
|
## Trust And Verification
|
|
224
222
|
|
|
225
|
-
Start with the **[Threat Model](THREAT_MODEL.md)
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
handles re-check tenant/principal rather than acting as bearer authority. Live
|
|
231
|
-
gates cover principal denial, no pre-approval mutation, idempotency, conflict,
|
|
232
|
-
bounded sets, compensation, and proposal/evidence freshness on disposable
|
|
233
|
-
databases.
|
|
234
|
-
|
|
235
|
-
Runner is a narrow agent/database safety boundary, not a replacement for
|
|
236
|
-
least-privilege database access, host security, or application authorization.
|
|
237
|
-
See [Security Boundary](docs/security-boundary.md) and
|
|
238
|
-
[Current Limitations](docs/limitations.md).
|
|
223
|
+
Start with the **[Threat Model](THREAT_MODEL.md)** and [Security
|
|
224
|
+
Boundary](docs/security-boundary.md). Conformance and live disposable-database
|
|
225
|
+
gates cover scope, hidden fields, no pre-approval mutation, idempotency,
|
|
226
|
+
conflicts, bounded sets, freshness, receipts, and replay. Runner does not
|
|
227
|
+
replace least-privilege roles, host security, or application authorization.
|
|
239
228
|
|
|
240
229
|
[Database scope]: docs/database-enforced-scope.md
|
|
241
230
|
[HTTP MCP]: docs/http-mcp.md
|
|
242
231
|
|
|
243
232
|
## Operate The Approval Loop
|
|
244
233
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
The ledger and secured Workbench also provide a Human Attention Inbox.
|
|
253
|
-
External notifications are disabled and quiet by default; an operator can route
|
|
254
|
-
review-required, UNKNOWN, reconciliation, dead-letter, drift, or sustained
|
|
255
|
-
health incidents through a signed generic webhook without granting the receiver
|
|
256
|
-
approval authority. A webhook response cannot approve, apply, or change Runner
|
|
257
|
-
state. See [Supervised Automatic
|
|
258
|
-
Apply](docs/supervised-automatic-apply.md), [Human Attention And
|
|
259
|
-
Notifications](docs/human-attention-notifications.md),
|
|
260
|
-
[Production](docs/production.md), and [Small Runner
|
|
261
|
-
Fleets](docs/running-a-runner-fleet.md).
|
|
234
|
+
Auto-approval does not mean auto-apply. Manual apply remains default unless the
|
|
235
|
+
exact contract digest and deployment both opt into a trusted supervised worker
|
|
236
|
+
that repeats all guards. External notifications are disabled and quiet by default.
|
|
237
|
+
A webhook response cannot approve or apply. See [Supervised
|
|
238
|
+
Apply](docs/supervised-automatic-apply.md) and
|
|
239
|
+
[Notifications](docs/human-attention-notifications.md).
|
|
262
240
|
|
|
263
241
|
## Packages
|
|
264
242
|
|
|
265
243
|
| Package | Purpose |
|
|
266
244
|
| --- | --- |
|
|
267
245
|
| `@synapsor/runner` | CLI, MCP runtime, local ledger, proposals, approval, guarded writeback, replay, and MCP audit. |
|
|
246
|
+
| `synapsor-runner` | Optional short command alias that delegates to the exact matching `@synapsor/runner`; no separate runtime. |
|
|
268
247
|
| `@synapsor/spec` | Canonical portable contracts for contexts, capabilities, workflows, evidence, proposals, receipts, and replay. |
|
|
269
248
|
| `@synapsor/dsl` | SQL-like authoring that compiles contexts, capabilities, and workflow declarations into canonical contract JSON. |
|
|
270
249
|
| `@synapsor/cli` | Synapsor Cloud administration, contract governance, human review, Runner connections, and shared audit records. |
|
|
@@ -292,6 +271,8 @@ guide](https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/cloud-cli.md).
|
|
|
292
271
|
- Follow the [step-by-step Synapsor Tutorial](https://github.com/sandeshtiwari/Synapsor-Tutorial).
|
|
293
272
|
- Run the [`support-billing-agent` flagship example](examples/support-billing-agent).
|
|
294
273
|
- Connect [Claude, Cursor, OpenAI Agents SDK, or another MCP client](docs/mcp-clients.md).
|
|
274
|
+
- Use the optional local [Workbench Ask](docs/workbench-ask.md) client without
|
|
275
|
+
broadening the reviewed tool surface.
|
|
295
276
|
- Author and [push a validated contract to Cloud](docs/cloud-push.md).
|
|
296
277
|
- Browse the [task-first documentation index](docs/README.md).
|
|
297
278
|
- Report bugs or request features through [GitHub Issues](https://github.com/Synapsor/Synapsor-Runner/issues).
|
package/SECURITY.md
CHANGED
|
@@ -8,12 +8,16 @@ Do not include production credentials, customer data, or full source rows in bug
|
|
|
8
8
|
|
|
9
9
|
Runner protects the local model/database boundary for reviewed semantic reads,
|
|
10
10
|
structured proposals, verified approval, guarded writeback, receipts, replay,
|
|
11
|
-
and optional exact-digest supervised
|
|
12
|
-
|
|
11
|
+
local authoring-only typed Explore/Protect, and optional exact-digest supervised
|
|
12
|
+
execution. Optional Workbench Ask calls only that same reviewed runtime surface.
|
|
13
|
+
Human-attention notifications are redacted interruption channels and never
|
|
14
|
+
authority.
|
|
13
15
|
|
|
14
16
|
It does not make the hosted Synapsor control plane self-hosted, prevent prompt
|
|
15
17
|
injection, replace database roles/RLS, or provide HA, compliance certification,
|
|
16
|
-
or a general database proxy.
|
|
18
|
+
or a general database proxy. Reviewed visible data sent to an
|
|
19
|
+
operator-selected model provider is subject to that provider's own privacy and
|
|
20
|
+
retention terms.
|
|
17
21
|
|
|
18
22
|
See `THREAT_MODEL.md` and `docs/security-boundary.md` for detailed trust
|
|
19
23
|
boundaries, covered threats, non-goals, and release blockers.
|
package/THREAT_MODEL.md
CHANGED
|
@@ -14,6 +14,11 @@ It is not a general MCP security gateway, not a prompt-injection cure, not a rep
|
|
|
14
14
|
Postgres proposal/evidence/replay ledger.
|
|
15
15
|
- Exact-digest supervised-worker policy, worker leases, attention events,
|
|
16
16
|
notification delivery records, and webhook signing secrets.
|
|
17
|
+
- Generated boundary drafts, review decisions, exact activation digests,
|
|
18
|
+
generation locks, reviewed relationship proofs, and Scoped Explore privacy
|
|
19
|
+
budgets.
|
|
20
|
+
- Optional Workbench Ask provider credentials and direct-egress consent held
|
|
21
|
+
only in the local process.
|
|
17
22
|
|
|
18
23
|
## Trust Boundaries
|
|
19
24
|
|
|
@@ -54,6 +59,27 @@ idempotency boundary for effects.
|
|
|
54
59
|
## Covered Threats
|
|
55
60
|
|
|
56
61
|
- Model asks for arbitrary SQL: no generic SQL tool is exposed in the Synapsor path.
|
|
62
|
+
- Model tries to turn Scoped Explore into generic SQL or production authority:
|
|
63
|
+
Explore accepts only reviewed typed plans, is local authoring-only, and is
|
|
64
|
+
absent from production, unknown-profile, remote, shared HTTP, and non-loopback
|
|
65
|
+
tool catalogs. Protect output starts disabled and requires exact-digest human
|
|
66
|
+
activation.
|
|
67
|
+
- Model invents or widens a join: aggregate relationships must be activated,
|
|
68
|
+
catalog-proven many-to-one paths with fan-out one; table/key/join semantics
|
|
69
|
+
and activation are not plan arguments. Ambiguous, one-to-many, many-to-many,
|
|
70
|
+
stale, and over-depth paths fail closed.
|
|
71
|
+
- Generated authority widens after schema/role drift: generated capability and
|
|
72
|
+
exploration authority are bound to schema, compiler/Spec, role, grant,
|
|
73
|
+
ownership, RLS, and reviewed-proof fingerprints. Manual legacy projects are
|
|
74
|
+
unaffected unless they adopt a generation lock.
|
|
75
|
+
- Optional Workbench Ask becomes a second policy engine: Ask lists and calls the
|
|
76
|
+
exact active MCP/runtime tools, adds no activation/approval/apply authority,
|
|
77
|
+
keeps provider choice outside model control, and treats provider prose/tool
|
|
78
|
+
arguments as untrusted.
|
|
79
|
+
- Provider endpoint exfiltration or SSRF: official origins are fixed, custom
|
|
80
|
+
remote origins require HTTPS, plaintext is loopback-only, redirects are
|
|
81
|
+
refused, DNS is revalidated and pinned, and private/link-local/metadata
|
|
82
|
+
destinations fail closed.
|
|
57
83
|
- Model supplies `tenant_id`, `principal`, source id, allowed columns, row version, or approval identity: runner rejects trusted-binding overrides.
|
|
58
84
|
- Prompt injection in database content asks the model to bypass policy: the runner ignores text as authority and only accepts structured capability/job state.
|
|
59
85
|
- Aggregate inference through a one-record group: reviewed aggregate tools
|
|
@@ -104,6 +130,9 @@ idempotency boundary for effects.
|
|
|
104
130
|
- Credential theft outside the runner process.
|
|
105
131
|
- OAuth, SSRF, token-passthrough, or confused-deputy bugs in unrelated MCP systems.
|
|
106
132
|
- Sensitive data already returned to a model.
|
|
133
|
+
- Reviewed visible data intentionally sent to an operator-selected external
|
|
134
|
+
model provider after Workbench egress consent; the provider's retention and
|
|
135
|
+
training policy remains outside Runner.
|
|
107
136
|
- Prompt injection itself.
|
|
108
137
|
- Business invariants not represented in the capability config, proposal, application handler, or database constraints.
|
|
109
138
|
- Generic multi-row business transactions, DDL, UPSERT, model-generated
|
|
@@ -136,6 +165,14 @@ idempotency boundary for effects.
|
|
|
136
165
|
queues; `dev_env` is unverified.
|
|
137
166
|
- Treat proposal/evidence/replay handles as identifiers, not authorization;
|
|
138
167
|
preserve verified per-session context on every networked resource read.
|
|
168
|
+
- Keep Scoped Explore and Workbench Ask local to explicit development/staging
|
|
169
|
+
authoring, verify a SELECT-only non-owner role, and disable Explore before
|
|
170
|
+
production. Production should serve only activated named capabilities.
|
|
171
|
+
- Review generation-lock and relationship-proof drift instead of bypassing it,
|
|
172
|
+
and do not treat Prisma/Drizzle/OpenAPI names as authorization.
|
|
173
|
+
- For Workbench Ask, choose provider/model/origin yourself, acknowledge direct
|
|
174
|
+
egress, keep keys out of project files and chat, and clear in-memory sessions
|
|
175
|
+
when finished.
|
|
139
176
|
|
|
140
177
|
## Release Blockers
|
|
141
178
|
|