Skip to content
eyeoverthinkPublic

About

Zero-dependency 3-layer verification SDK, CLI, and stdio MCP server for AI agents: SVA-ER/1 & IETF AER-1 receipts, OPEG/1 execution gates, StreamSealGuard split-token privacy membrane, SVA-JEV/1 calibrated epistemic judge, and zero-LLM skill crystallization. Apache-2.0.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

@eyeoverthink/sva-gate (v2.1.0)

2.1.0 — privacy membrane and skill crystallizer fixes (synced with @eyeoverthink/privacy-membrane 1.4.0 and @eyeoverthink/skill-crystallizer 1.3.0). StreamSealGuard no longer leaks a JWT, PEM key, email, password or titled name whose fragment arrives as its own chunk; SealSession.unseal(text, { strict: true }) restores only the exact ⟦TYPE_n⟧ placeholders the session issued; detection is linear on adversarial input. The skill binder now refuses quantity and negation words its examples never used ("Two $240 coats…", "…is not 25% off…") and tasks on which two rules that both fit the examples disagree; explainApply says why. MCP serverInfo.version now reports the package version.

2.0.0 — breaking: verification now asks whose signature counts. A receipt is ok only when it is intact and signed by a key you name in expectedPublicKeys (CLI: --key <hex>). Without it an intact receipt is outcome: 'integrity_only', because anyone can mint an intact receipt with their own key. Small-order Ed25519 keys (which verify any message with no private key) are refused. AER-1 v0.4 receipts carry no issuer signature and are reported as integrity_only; their deliverable is now checked against the outputs. The Merkle tree is now real RFC 6962 (raw digest bytes); receipts minted by 1.x still verify and report merkleEncoding: 'legacy-hex-text'. allowUnpinned: true (CLI --allow-unpinned) restores the 1.x behaviour for demos and migration.

CI: Node + MCP + Python License: Apache-2.0

Zero-dependency 3-layer verification SDK, CLI, and stdio MCP server for AI agents.

Unifies the proven standards from eyeoverthink/sva-standard (v1.7.0, 106/106 tri-runtime conformance) and eyeoverthink/logic-chain-judge (v1.0.0, 321 tests) into one installable package with zero external runtime dependencies (Node 22+ ESM with TypeScript .d.ts definitions + pure Python 3.10+ stdlib companion in python/).


1. Drop Into Claude Code / Cursor / Codex / Any MCP Client (4 Lines)

{
  "mcpServers": {
    "sva-gate": {
      "command": "npx",
      "args": ["-y", "@eyeoverthink/sva-gate", "mcp"]
    }
  }
}

Gives any agent 6 deterministic verification tools over stdio JSON-RPC 2.0:

MCP Tool Layer What It Enforces
sva_seal_text Layer 2 (EMA/1) Seals PII/secrets (emails, SSNs, API keys, phones) into typed placeholders + StreamSealGuard cross-token split-secret sealing + keyword/zero-width prompt-injection scan
sva_mint_receipt Layer 1 (SVA-ER/1) Mints an Ed25519-signed, RFC 6962 0x00/0x01 Merkle-proven receipt + matching OPEG/1 S4_COMMIT envelope
sva_verify_receipt Layer 1 (SVA-ER/1 + AER-1) Verifies SVA-ER/1 receipts against a key you pin, and checks AER-1 v0.4 receipts (an individual Internet-Draft, draft-zambo-aer1-26, not an IETF standard) offline. AER-1 receipts carry no issuer signature, so they are reported as integrity_only
sva_opeg_check Layer 2 (OPEG/1) Fail-closed pre-commit gate: blocks DIRECT_INFERENCE, tampered R_san digests, and invalid receipts (sva-er/1 or aer-1)
sva_judge_audit Layer 3 (SVA-JEV/1) Rule checks over judge results you supply (no model call): Wilson 95% CI > 2/3 on your counts, author self-vote exclusion, mandatory verbatim >= 12-char quotes, hidden planted-fake traps, and zero-LLM new_terms invention scanner
sva_crystallize_skill Layer 1 (VSC/1) Zero-LLM deterministic parameter binder induction with leave-one-out verification; refuses novel wording, unseen quantity/negation words and ambiguous rules (testResult.refused says why)

2. CLI Quick Start (10-Second Offline Self-Test)

# Run built-in 3-layer verification (receipts + OPEG tamper block + StreamSealGuard + SVA-JEV/1 + skill crystallizer)
npx @eyeoverthink/sva-gate self-test

# Seal secrets & scan for prompt injection
npx @eyeoverthink/sva-gate seal "Patient SSN 123-45-6789 key sk-ant-api03-abcdefghijklmnop1234567890"

# Demo cross-token split-secret streaming redaction
npx @eyeoverthink/sva-gate stream-demo

# Mint a signed SVA-ER/1 receipt + OPEG/1 envelope
npx @eyeoverthink/sva-gate mint '{"answer":42,"unit":"ms"}'

# Verify an SVA-ER/1 OR IETF AER-1 v0.4 receipt offline
npx @eyeoverthink/sva-gate verify receipt.json [deliverable.json]

# Evaluate an OPEG/1 gate or SVA-JEV/1 judge envelope fail-closed
npx @eyeoverthink/sva-gate gate opeg-envelope.json
npx @eyeoverthink/sva-gate judge jev-envelope.json

3. JS / TypeScript SDK (0 Dependencies)

import {
  mintSvaEr1,
  verifyAnyReceipt,
  evaluateOpeg1,
  evaluateSvaJev1,
  StreamSealGuard,
  JEV_SEMANTICS,
} from '@eyeoverthink/sva-gate';

// 1. Mint & verify an SVA-ER/1 receipt + OPEG/1 S4_COMMIT envelope
const { receipt, deliverable, opegEnvelope, publicKeyHex } = mintSvaEr1({ rSan: { ok: true, value: 42 } });
// Name the key you trust. The verifier never trusts the key inside the receipt by itself.
const trust = { expectedPublicKeys: [publicKeyHex] };
console.log(verifyAnyReceipt(receipt, { deliverable, ...trust })); // { format: 'sva-er/1', ok: true, outcome: 'verified', trust: 'pinned', ... }
console.log(evaluateOpeg1(opegEnvelope, trust));                // { ok: true, gate: 'pass', ... }
console.log(verifyAnyReceipt(receipt, { deliverable }));        // { ok: false, outcome: 'integrity_only', ... } — intact, signer not trusted

// 2. Seal split-token API keys across streaming chunks
const sg = new StreamSealGuard();
const safe = ['Key sk-', 'ant-api03-abcdefghijklmnop1234567890 ok'].map((c) => sg.push(c)).join('') + sg.flush();
// -> 'Key ⟦SECRET_1⟧ ok'. Put values back only in text a person you trust will read; strict ignores bare EMAIL_1 etc.
const restored = sg.session.unseal(modelReply, { strict: true });

// 3. Enforce SVA-JEV/1 epistemic judge gates
const verdict = evaluateSvaJev1({
  spec: 'sva-jev/1',
  semantics: JEV_SEMANTICS,
  mode: 'claim_trace',
  ledgerTexts: ['[stage 1] Enforce 80% quorum via verify_run.'],
  briefText: 'Enforce 80% quorum with 9999 retries via invented_helper_v2.',
  plantedFakes: [{ id: 'fake-1', verdict: 'unsupported' }],
});
// -> { ok: false, newTerms: ['9999', 'invented_helper_v2'], ... }

4. Pure Python 3.10+ Companion (python/)

Zero pip dependencies (standard library only):

pip install ./python
python -m unittest discover -s python/tests -v
from sva_gate import JEV_SEMANTICS, evaluate_sva_jev1
res = evaluate_sva_jev1({
    "spec": "sva-jev/1",
    "semantics": JEV_SEMANTICS,
    "mode": "calibration",
    "answered": 36, "total": 36, "right": 33, "realFound": 12, "realTotal": 12,
})

Honest Limits

  • The privacy membrane is regex-based. It misses IPv6 addresses, SSNs written without dashes and names without a title. Default (lenient) unseal also restores [EMAIL_1], <EMAIL_1> and the bare word EMAIL_1, so any text that names a placeholder receives the real value; use { strict: true } for text shown to others. The streaming guard emits each word when the next whitespace arrives, and only holds what a detector could recognise.

  • The skill binder gates a fixed list of quantity and negation words before numbers, not every meaning-changing phrase; treat a routed answer as a draft for templated tasks only.

  • The prompt-injection scan is a keyword list. Paraphrases, other languages and homoglyphs score 0.

  • Signatures prove post-signing integrity and key possession, not that a compromised host didn't fabricate data prior to signing. Local unsynced clocks are explicitly labeled unattested.

  • SVA-JEV/1 verdicts are stamped stability-signal-not-correctness — multi-model consensus is never proof of truth.

  • Deterministic new_terms catches invented numbers and code identifiers, not subtle semantic paraphrasing.

Related Repositories & Live Offline Playgrounds

License

Apache-2.0 — see LICENSE.

About

Zero-dependency 3-layer verification SDK, CLI, and stdio MCP server for AI agents: SVA-ER/1 & IETF AER-1 receipts, OPEG/1 execution gates, StreamSealGuard split-token privacy membrane, SVA-JEV/1 calibrated epistemic judge, and zero-LLM skill crystallization. Apache-2.0.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages