@conarium-ai/core 0.2.23 → 0.2.25

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/CHANGELOG.md CHANGED
@@ -1,5 +1,87 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.25 — 2026-08-17
4
+
5
+ A documented command was never installed. It was found by running the README on a
6
+ machine that had never seen this package — the one path no test had walked, because
7
+ every test walks it from the repository, where the paths resolve.
8
+
9
+ - **`npx conarium-anchor-service` resolves.** The countersigning endpoint was
10
+ documented in the README, shipped in the tarball as
11
+ `bin/conarium-anchor-service.mjs`, correctly shebanged, and fail-closed on
12
+ missing configuration. It was never listed in package.json `bin`, so npm looked
13
+ for a package by that name in the registry and answered E404 — for as long as
14
+ the file had existed. It is registered now; starting it without a token file or
15
+ a signing key exits 2 and names what is missing, as the README says it does.
16
+
17
+ - **Documented commands are checked against installed commands, both ways.**
18
+ `test/bin_claims.mjs` reads the `npx conarium-*` invocations out of README,
19
+ SECURITY, LIMITATIONS and `docs/` and fails when one of them is absent from
20
+ package.json `bin`; it also asserts every registered bin exists and carries a
21
+ shebang. Neither list is restated in the test. A `stranger-install` CI job
22
+ installs the packed tarball into an empty directory and checks the opposite
23
+ direction — that every registered command resolves without asking the registry.
24
+ A loop over `bin` cannot catch an unregistered name, and an offline test cannot
25
+ see how npm resolves after install, so both directions are needed.
26
+
27
+ - **The README's commands run where the README puts them.** Four blocks were
28
+ command references written as if they were sequences. `conarium-init` writes keys
29
+ and config, not receipts, so three `conarium-verify` lines answered 20 on a file
30
+ that does not exist yet; `declaration.json` and the `pg_stat_statements`
31
+ snapshots are not generated either; the repository ships a
32
+ `conarium.config.json`, so `node bin/conarium-init.mjs` correctly refused to
33
+ overwrite it and exited 1; and `conarium-doctor` was placed before the step that
34
+ points the config at a DSN, so it reported the placeholder host unreachable. The
35
+ runnable commands now use the demo chain the reader downloaded in the section
36
+ above, and the exit codes are stated — including `--anchor-check` answering 14 on
37
+ a chain that ships without a sidecar, which is the intended answer, since an
38
+ absent anchor is not a verified one. The rest name their prerequisites instead
39
+ of implying they have none.
40
+
41
+ - **Policy pages no longer assert past their own inventory.** `privacy.html` said
42
+ "We never receive, see, or store your data or your customers' data" and then
43
+ itemised the waitlist email it stores, the chat it forwards to a third-party
44
+ model, and the host logs it keeps; `terms.html` made the same claim with no
45
+ itemisation at all. The self-hosted claim is true and kept, now scoped to what
46
+ it covers: the data Conarium governs never reaches us. `test/claim_discipline.mjs`
47
+ had been reading both files and could not see this, because it only knows
48
+ phrasings already caught — the phrasing is in it now.
49
+
50
+ ## 0.2.24 — 2026-08-17
51
+
52
+ Documentation that shipped with 0.2.23 still carried claims this project had
53
+ already retracted, and the reason it could is now checked rather than remembered.
54
+
55
+ - **The published claims match the repository's.** 0.2.23 went to npm, and README,
56
+ SECURITY, LIMITATIONS and the architecture note were corrected afterwards on the
57
+ same version number. Anyone installing 0.2.23 received the corrected code with
58
+ the uncorrected wording: "Immutable Audit Ledger", "never sees your secrets",
59
+ "without exposing a single secret", "every access is logged". This release
60
+ carries the corrections. `README` now says what the mechanism establishes —
61
+ the ledger is tamper-evident rather than immutable, because a hash chain makes
62
+ alteration and mid-chain removal detectable and does not make the file
63
+ impossible to delete; masking hides a value and does not make it unlearnable,
64
+ which is what `protectedColumns` narrows and `LIMITATIONS` states.
65
+
66
+ - **A version number is a claim, so it is checked.** `test/version_claim.mjs`
67
+ fails when a release tag exists for the version in package.json and any file npm
68
+ would ship differs from that tag. The file list comes from `npm pack --dry-run`
69
+ rather than a second copy of the `files` array, because a restated list is one
70
+ more hand-written claim that can drift. This is the check that would have caught
71
+ both 0.2.21 and 0.2.23 the same day instead of a day later.
72
+
73
+ - **`engines` is Node >=20, and every major it covers is exercised.** It said >=18,
74
+ which was wrong rather than unverified: the MCP SDK's HTTP transport uses the
75
+ global `crypto`, available without a flag only from Node 19, so on Node 18 the
76
+ gateway failed at `initialize`. CI now runs the suite on 20, 22 and 24, plus the
77
+ documented first-run path on each. Node 18 and Node 20 are both past end-of-life;
78
+ 20 is kept because it is verified to work, and LIMITATIONS says so and names 22+.
79
+
80
+ - **SECURITY.md no longer contradicts LIMITATIONS** about whether a
81
+ Conarium-operated countersigning endpoint exists. It has since 2026-08-15; one
82
+ document was updated and the other was not, and `test/claim_discipline.mjs` now
83
+ fails on that specific pair of statements.
84
+
3
85
  ## 0.2.23 — 2026-08-17
4
86
 
5
87
  A property run found the first item at random; the second is a gap this project
package/LIMITATIONS.md CHANGED
@@ -10,6 +10,21 @@ No SOC 2. No ISO. No independent penetration test. On the roadmap.
10
10
 
11
11
  Version is 0.2.x. The API can break.
12
12
 
13
+ ## Node 20 is the floor, and Node 20 is past end-of-life
14
+
15
+ `engines` requires Node >=20 and CI runs the full suite on 20, 22 and 24. It said
16
+ >=18 until 2026-08-17, and that was wrong rather than merely unverified: the MCP
17
+ SDK's HTTP transport uses the global `crypto`, which is available without a flag
18
+ only from Node 19, so on Node 18 the gateway fails at `initialize` with
19
+ `ReferenceError: crypto is not defined`.
20
+
21
+ Both Node 18 (2025-04-30) and Node 20 (2026-04-30) are past end-of-life in the
22
+ nodejs/Release schedule, so a Node 20 install is running a runtime that no longer
23
+ receives security patches. Node 20 is kept as the floor because it is verified to
24
+ work and removing it would break installations for a reason their operators did not
25
+ ask for. Node 22 or later is the version to run; if you are on 20, that choice is
26
+ yours to make with this stated rather than hidden.
27
+
13
28
  ## SQL is Postgres, Microsoft SQL Server, and Oracle
14
29
 
15
30
  MySQL is not implemented.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
2
  <h1>Conarium</h1>
3
3
  <p><strong>The Third Eye for Your Company's Data.</strong></p>
4
- <p>A self-hosted, governed gateway that lets AI coding assistants (Cursor, Copilot, Claude) touch your real data—without exposing a single secret—and hands you a signed, independently verifiable receipt of every access.</p>
4
+ <p>A self-hosted, governed gateway that lets AI coding assistants (Cursor, Copilot, Claude) touch your real data under a policy you write—protected values masked before they leave—and hands you a signed, independently verifiable receipt of every access it mediates.</p>
5
5
 
6
6
  <p>
7
7
  <a href="https://www.npmjs.com/package/@conarium-ai/core"><img src="https://img.shields.io/npm/v/@conarium-ai/core?style=for-the-badge" alt="npm" /></a>
@@ -68,18 +68,18 @@ Point Cursor or Copilot at a production database and it drinks the raw stream—
68
68
 
69
69
  Conarium acts as a high-performance **MCP (Model Context Protocol) Proxy**. It sits directly between the AI Assistant and your databases, evaluating policies in milliseconds to enforce row limits and mask PII (Personally Identifiable Information) on the wire.
70
70
 
71
- The AI gets the context it needs to write code, but never sees your secrets.
71
+ The AI gets the context it needs to write code; the values your policy protects are masked before they reach it. Masking hides a value — it does not make it unlearnable, and where a request language allows predicates over a protected column, an allowed query can still answer questions about one. `protectedColumns` is the narrower answer to that, and the limit is stated in [LIMITATIONS.md](LIMITATIONS.md) rather than left for you to discover.
72
72
 
73
73
  ### Key Features
74
74
 
75
75
  - **Inline PII Masking:** Emails, IDs, cards, and secrets are redacted in the response stream (`[MASKED_PII]` / `[MASKED_SECRET]`) before the model sees a single character.
76
76
  - **Allow / Deny Lists:** Whitelist what AI can access. Your `secrets` and `financials` tables stay invisible.
77
77
  - **Row Caps:** Hard per-query limits. Prevent the silent exfiltration of millions of rows.
78
- - **Immutable Audit Ledger:** Every access is logged (who, what, when, rows, decision). Hash-chained and PII-safe — no raw PII ever written to the logs.
78
+ - **Tamper-Evident Audit Ledger:** Every access *through Conarium* is logged (who, what, when, rows, decision). Hash-chained, which makes alteration and mid-chain removal detectable — not impossible: a file on disk can still be deleted or truncated, and catching truncation needs a pin from outside the file (see Coverage & Reconciliation below). PII-safe: no raw PII is written to the logs.
79
79
  - **Verifiable Receipts:** Ed25519-signed, independently verifiable receipts — see below.
80
80
  - **Per-person masking profiles:** what to mask for an AI agent is not what to mask for the data controller. A named profile relaxes masking for one identified person, and the receipt records which profile applied — see below.
81
81
  - **Coverage & Reconciliation:** a signed coverage declaration over the receipt chain (`conarium-coverage`), plus two-sided reconciliation against the database's own query counters (`conarium-reconcile`) — DB-recorded activity that no receipt covers is surfaced instead of staying invisible.
82
- - **100% Self-Hosted:** Runs entirely on your infrastructure. Your data never crosses your perimeter. The gateway makes exactly one outbound request that is not yours: at startup it asks the public npm registry whether a newer version exists, and prints one line to stderr if so. It sends nothing about you — no identifier, no config, no counts — and a remote gateway nobody looks at for weeks is the reason it exists at all. Disable it with `CONARIUM_NO_UPDATE_CHECK=1`, or point it at your internal mirror with `CONARIUM_NPM_REGISTRY`. It has a 2-second timeout and never blocks or fails startup. We list it here because a governance product that makes an undisclosed outbound connection has already lost the argument.
82
+ - **100% Self-Hosted:** Runs entirely on your infrastructure. Nothing we ship transmits your data anywhere: raw protected values stay inside your perimeter, and what reaches your AI client is the policy-approved disclosure — whose exact bytes the receipt records (`disclosure.hash`). Saying your data never leaves at all would be the wrong claim: releasing a governed disclosure to an assistant is the job. The gateway makes exactly one outbound request that is not yours: at startup it asks the public npm registry whether a newer version exists, and prints one line to stderr if so. It sends nothing about you — no identifier, no config, no counts — and a remote gateway nobody looks at for weeks is the reason it exists at all. Disable it with `CONARIUM_NO_UPDATE_CHECK=1`, or point it at your internal mirror with `CONARIUM_NPM_REGISTRY`. It has a 2-second timeout and never blocks or fails startup. We list it here because a governance product that makes an undisclosed outbound connection has already lost the argument.
83
83
  - **MCP-Native:** Works out of the box with **Cursor**, **GitHub Copilot**, **Claude Code**, and **Codex**.
84
84
 
85
85
  ### Verifiable Receipts
@@ -110,14 +110,21 @@ npx conarium-init
110
110
 
111
111
  export CONARIUM_AUDIT_SIGNING_KEY=./audit-ed25519.pem
112
112
 
113
+ # init writes keys and config, not receipts: your own audit file does not exist
114
+ # until the gateway has served a query. The three commands below therefore run
115
+ # against the demo chain downloaded above, so they work as written — swap in
116
+ # your own sink (conarium.config.json → audit.sink) once it has records.
117
+
113
118
  # Verify a receipt chain (exit 0 = the records *in the file* are intact)
114
- npx conarium-verify ./receipts.jsonl --pubkey ./audit-ed25519.pub.pem
119
+ npx conarium-verify chain.jsonl --pubkey key.pem
115
120
 
116
121
  # Pin length / last hash if you need to catch records dropped from the end
117
- npx conarium-verify ./receipts.jsonl --pubkey ./audit-ed25519.pub.pem --expect-count 3
122
+ npx conarium-verify chain.jsonl --pubkey key.pem --expect-count 3
118
123
 
119
- # Optional: check OpenTimestamps sidecar (pending → exit 0 + warning; missing → 14)
120
- npx conarium-verify ./receipts.jsonl --pubkey ./audit-ed25519.pub.pem --anchor-check
124
+ # Check the OpenTimestamps sidecar. The demo chain ships without one, so this
125
+ # answers 14, deliberately not 0: an absent anchor is not a verified anchor.
126
+ # A sidecar that exists but is not yet confirmed → exit 0 with a warning.
127
+ npx conarium-verify chain.jsonl --pubkey key.pem --anchor-check
121
128
  ```
122
129
 
123
130
  A second verifier, Go and the standard library only, is in [`verifiers/go`](verifiers/go). `go build -o conarium-verify .` then the same arguments as `conarium-verify`; `test-vectors/` is the contract.
@@ -248,6 +255,12 @@ everywhere and would shred the output) and matches on Unicode word boundaries, s
248
255
  Receipts prove what went **through** the gateway. Reconciliation asks the database
249
256
  what it saw, and compares:
250
257
 
258
+ Neither command invents its inputs and `conarium-init` does not create them, so
259
+ both answer **20 (input missing)** until you have produced them: `declaration.json`
260
+ is your own period-and-scope statement ([`docs/RECEIPT-SPEC.md`](docs/RECEIPT-SPEC.md)
261
+ names the fields), and the two snapshots come from
262
+ [`scripts/pg-snapshot.sql`](scripts/pg-snapshot.sql).
263
+
251
264
  ```bash
252
265
  # One-sided: signed coverage declaration over a period + declared scope
253
266
  npx conarium-coverage ./declaration.json --pubkey ./audit-ed25519.pub.pem --receipts ./receipts.jsonl
@@ -286,13 +299,17 @@ The service is in this package, so you can run your own and sign your own heads
286
299
  above. What makes it worth anything is that the signer is not you.
287
300
 
288
301
  ```bash
289
- # Run the endpoint (refuses to start without a signing key or a token file)
302
+ # Run the endpoint. It refuses to start without a signing key or a token file:
303
+ # with neither present the three lines below exit 2 and name what is missing,
304
+ # which is the intended answer, not a failed install. Generating both is in
305
+ # deploy/anchor-service/.
290
306
  CONARIUM_ANCHOR_TOKENS=./anchor.tokens.json \
291
307
  CONARIUM_ANCHOR_SIGNING_KEY=./anchor.pem \
292
308
  CONARIUM_ANCHOR_BASE_URL=https://anchor.example.com \
293
309
  npx conarium-anchor-service
294
310
 
295
- # Verify a countersignature you were given — offline, no network, no package
311
+ # Verify a countersignature you were given — offline, no network, no package.
312
+ # record.json is what the endpoint returned to you; without it, exit 20.
296
313
  npx conarium-countersign-verify ./record.json --pubkey ./anchor.pub.pem
297
314
  # exit 0 = signature valid (and inclusion valid if a proof or --log-url was given)
298
315
  # exit 13 = signature invalid / unknown keyId
@@ -424,7 +441,7 @@ graph LR
424
441
 
425
442
  1. **The Gateway:** A proxy that speaks fluently to LLM assistants.
426
443
  2. **The Engine:** Evaluates JSON policies, regex scans, and row caps in milliseconds.
427
- 3. **The Ledger:** An immutable audit log recording every query and decision.
444
+ 3. **The Ledger:** A tamper-evident audit log recording every query and decision it mediates.
428
445
 
429
446
  ---
430
447
 
@@ -438,7 +455,11 @@ npm i @conarium-ai/core
438
455
  npx conarium-init
439
456
  export CONARIUM_AUDIT_SIGNING_KEY="$PWD/audit-ed25519.pem"
440
457
 
441
- # 3. Check the install before trusting it
458
+ # 3. Check the install before trusting it. Until step 4 points the config at a
459
+ # reachable DSN, doctor reports the placeholder host unreachable and exits 1.
460
+ # That FAIL is the check working, not the install being broken — it is the one
461
+ # thing a gateway must not be quiet about, because it keeps running with zero
462
+ # connectors and looks healthy while serving nothing.
442
463
  npx conarium-doctor
443
464
 
444
465
  # 4. Point the generated conarium.config.json at your read-only DSN,
@@ -459,7 +480,9 @@ its output is safe to paste into an issue.
459
480
  git clone https://github.com/dogrucanemek-alt/conarium.git
460
481
  cd conarium
461
482
  npm install && npm run build
462
- node bin/conarium-init.mjs
483
+ # The repository already ships a conarium.config.json, so init refuses rather
484
+ # than overwrite it (exit 1). Pass --force only if you want it regenerated.
485
+ node bin/conarium-init.mjs --force
463
486
  node bin/conarium-doctor.mjs --no-net
464
487
  npm start
465
488
  ```
@@ -629,7 +652,7 @@ Conarium is **early access** — and honest about what's real:
629
652
 
630
653
  **Shipping now:** governed MCP gateway (stdio + HTTP) · deterministic PII masking,
631
654
  including labelled names in free text · allow/deny + row caps · per-person masking
632
- profiles · immutable hash-chained audit ledger · Ed25519-signed receipt per access
655
+ profiles · tamper-evident hash-chained audit ledger · Ed25519-signed receipt per access
633
656
  with an offline verifier · signed coverage declarations · two-sided reconciliation
634
657
  against the database's own counters · OpenTimestamps anchoring and an optional
635
658
  anchoring service · conformance vectors · SQL gate: Postgres, Microsoft SQL Server, Oracle
package/SECURITY.md CHANGED
@@ -52,8 +52,10 @@ rather than served.
52
52
  What the key protects is the whole product: a leaked signing key makes every
53
53
  countersignature it ever produced worthless, including past ones. Custody,
54
54
  rotation, and what a compromise costs are in
55
- [`docs/COUNTERSIGN.md`](docs/COUNTERSIGN.md). Conarium does not operate a
56
- public countersigning endpoint yet.
55
+ [`docs/COUNTERSIGN.md`](docs/COUNTERSIGN.md). Since 2026-08-15 a
56
+ Conarium-operated endpoint does exist (`demo.conarium.dev/anchor`, keyId
57
+ `verax-cs-20260815`), on one server with the key on disk and no HSM; it is not
58
+ open to customers. The limits are in [`LIMITATIONS.md`](LIMITATIONS.md).
57
59
 
58
60
  The tester pack is [`docs/security/THREAT-MODEL.md`](docs/security/THREAT-MODEL.md)
59
61
  and [`docs/security/PENTEST-SCOPE.md`](docs/security/PENTEST-SCOPE.md).
@@ -6,7 +6,7 @@ MCP made "connect an AI assistant to your data" a commodity. The durable value i
6
6
 
7
7
  1. **Ingestion** of messy internal sources (schemas today; docs, ADRs, APIs next).
8
8
  2. **Governance + audit** — what the AI may see, and a record of what it saw.
9
- 3. **Self-hosting** — data never leaves the customer's network.
9
+ 3. **Self-hosting** — the gateway runs in the customer's network and transmits nothing outward on its own. Raw protected values stay there; the policy-approved disclosure is what reaches the customer's AI client, and `disclosure.hash` binds exactly which bytes those were.
10
10
  4. **Freshness** — incremental re-index so context never goes stale.
11
11
 
12
12
  Conarium owns this layer and stays **tool-agnostic**: it speaks MCP, so it plugs into Cursor, Copilot, Claude Code, Windsurf, Continue.dev — whatever wins.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conarium-ai/core",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "mcpName": "io.github.dogrucanemek-alt/conarium",
5
5
  "//files-artefakt": "examples/ altindaki uretilmis dosyalar (ozel anahtar, makbuz/denetim JSONL) ELENIR. .gitignore npm'i baglamaz: izin listesinde 'examples' oldugu icin demoyu kosturmus bir makinede 'npm publish' _keys/audit-ed25519.pem'i (OZEL ANAHTAR) ve makbuzlari yayinliyordu. test/pack_artefakt.mjs bunu kilitler. Elemeler examples/ ile SINIRLI: test-vectors/ altindaki receipts.jsonl ve .pub.pem YAYINLANMAK ZORUNDA, yoksa ucuncu taraf konformans vektorlerini kosturamaz.",
6
6
  "//files": "Pakete NE gireceginin izin listesi. Liste olmadan npm her seyi gonderiyordu: 296 dosya / 1.5 MB — CI workflowlari, gitleaks ayari, 137 KB pazarlama gorseli, sitenin api/chat.js dosyasi. Bir bankanin guvenlik ekibi tarball'i acip bunlari gorur. scripts/ BILEREK var: conarium-reconcile calisirken scripts/pg-snapshot.sql'e atif yapiyor, olmazsa kullanici destek maili yazar.",
@@ -75,6 +75,7 @@
75
75
  "conarium-coverage": "bin/conarium-coverage.mjs",
76
76
  "conarium-reconcile": "bin/conarium-reconcile.mjs",
77
77
  "conarium-stamp": "bin/conarium-stamp.mjs",
78
+ "conarium-anchor-service": "bin/conarium-anchor-service.mjs",
78
79
  "conarium-anchor-upgrade": "bin/conarium-anchor-upgrade.mjs",
79
80
  "conarium-console": "bin/conarium-console.mjs",
80
81
  "conarium-suggest-policy": "bin/conarium-suggest-policy.mjs"
@@ -114,6 +115,6 @@
114
115
  "vitest": "^4.1.10"
115
116
  },
116
117
  "engines": {
117
- "node": ">=18"
118
+ "node": ">=20"
118
119
  }
119
120
  }