Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ List the targeted checks you ran.

- [ ] Behavior changes include tests that use real temporary files.
- [ ] Model pathways still cannot write Bronze, knowledge, trust, receipts, reviewed metadata, or indexes.
- [ ] No signer, apply, approve, promote command, or `--promote` flag was added.
- [ ] No signing, apply, approve, or promote path was added to the Ziggurat runtime (CLI, MCP server and `src/`); no `--promote` flag was added.
- [ ] Retrieved content remains reference-only with `instruction_authority: none`.
- [ ] Documentation and compatibility notes match the implementation.
- [ ] `npm run check` passes.
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ debug-output.txt

# Local model evaluation artifacts
.model-runs/

*.pem
examples/external-signer/node_modules/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ziggurat

Ziggurat is a local TypeScript reference implementation of a write gate for AI memory. A model can propose what an AI system should remember, with exact citations to stored evidence. Nothing becomes durable context, which Ziggurat calls Gold, until a key listed in `config/trust.yaml` signs a detached Ed25519 receipt for that exact page. Ziggurat assumes the operator keeps that key outside model-accessible processes; it does not enforce where the key lives. Ziggurat ships no promote, approve, apply, or signer command. `ingest` is the only writer of evidence (Bronze), and `refine` writes only proposals (Silver).
Ziggurat is a local TypeScript reference implementation of a write gate for AI memory. A model can propose what an AI system should remember, with exact citations to stored evidence. Nothing becomes durable context, which Ziggurat calls Gold, until a key listed in `config/trust.yaml` signs a detached Ed25519 receipt for that exact page. Ziggurat assumes the operator keeps that key outside model-accessible processes; it does not enforce where the key lives. The Ziggurat runtime (CLI, MCP server and `src/`) has no signing, approval, apply or promotion command. The repository also contains a standalone reference signer in `examples/external-signer/`, meant to run outside the vault under the key holder's control. Tests sign only with disposable keys they generate. `ingest` is the only writer of evidence (Bronze), and `refine` writes only proposals (Silver).

Documentation: [patschmittdev.github.io/Ziggurat](https://patschmittdev.github.io/Ziggurat/).

Expand Down Expand Up @@ -60,7 +60,7 @@ node dist/src/cli/main.js query --root ./my-vault --query garden

Gold is empty because no page has external authorization. Ingest creates and verifies a new Bronze record before deleting the inbox source; a duplicate leaves its source untouched. Fresh captures are restricted and PII-unknown, so default model access excludes them.

Continue with [your first vault](site/src/content/docs/getting-started/first-vault.md) and [ingest and refine](site/src/content/docs/guides/ingest-and-refine.md).
Continue with [Sign a page and reach Gold](site/src/content/docs/guides/external-signing.md), [Run Ziggurat with models and agents](site/src/content/docs/guides/agents-and-models.md), [your first vault](site/src/content/docs/getting-started/first-vault.md) and [ingest and refine](site/src/content/docs/guides/ingest-and-refine.md).

## How it works

Expand Down
4 changes: 3 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ The latest commit on the default branch receives security fixes. There are no ta

## Scope

Defects in `examples/external-signer/` are in scope, including showing different content than it signs, mishandling keys, or defective location checks.

In scope: bypasses of receipt admission, citation or index integrity, vault path boundaries, privacy filtering, and model transport restrictions in shipped code.

Out of scope: operator-controlled filesystem or trust-policy replacement, external signer compromise, and factual truth or human attention that the implementation does not establish. Report implementation failures that cross the documented boundary even when they start with hostile source content.
Out of scope: operator-controlled filesystem or trust-policy replacement, compromise of the signing environment itself, and factual truth or human attention that the implementation does not establish. Report implementation failures that cross the documented boundary even when they start with hostile source content.

Read the [threat model](site/src/content/docs/security/threat-model.md) for assumptions, controls, and residual risks, and [guarantees](site/src/content/docs/security/guarantees.md) for enforced boundaries.
9 changes: 5 additions & 4 deletions docs/authorization-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ project is pre-release, so future versions may introduce a new receipt or
canonicalization version rather than changing version 1 in place.

The protocol lets an external human-controlled signer authorize one exact knowledge
page for Gold admission. Ziggurat verifies signatures but intentionally ships no
signing, approval, apply, or promotion command.
page for Gold admission. The Ziggurat runtime (CLI, MCP server and `src/`) verifies signatures and has no
signing, approval, apply or promotion command. The repository also contains a
standalone reference signer in `examples/external-signer/`, meant to run outside
the vault under the key holder's control. Tests sign only with disposable keys they generate.

## Trust model

Expand Down Expand Up @@ -171,8 +173,7 @@ is a deterministic vector file for independent signer implementations. It contai
- `cases[]`, each with a page body, a receipt, the trust policy to load, and the
expected `{ valid, reasons }` verification result

No private key material is published. Verification, which is the only operation
Ziggurat performs, needs only the public key. A signer implementation is conformant
No private key material is published. Verification in the Ziggurat runtime needs only the public key. A signer implementation is conformant
when it reproduces `canonical_page_content`, `content_sha256`, and `signing_payload`
byte for byte from the frontmatter and body alone, and verifies the supplied
signature against the published public key. A new signature made with an
Expand Down
11 changes: 6 additions & 5 deletions docs/external-signing-interop.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# External signing interoperability

Ziggurat verifies receipts. It does not provide a signing command, obtain a private
The Ziggurat runtime verifies receipts. It has no signing command and does not obtain a private
key, establish human attention, or turn a review checklist into authorization.
The separately controlled signing environment must belong to the reviewer and
must not be exposed through model tools, MCP, or the vault's automation.
Expand All @@ -24,7 +24,8 @@ npm run test:interop

`ZIGGURAT_INTEROP_PYTHON` can select a separate Python executable. Missing Python
or the package fails this explicit test rather than becoming a passing skip.
The default core test command does not install or invoke an external signer.
The default core test command invokes the standalone Node reference signer with
disposable keys. It does not install signer dependencies.
The harness uses only published vectors and disposable test keys; it is not a
command for authorizing real pages.

Expand Down Expand Up @@ -57,9 +58,9 @@ payload defined by receipt v1.
7. Rebuild and inspect eligibility reasons. Changing the page after signing, using
a removed key, or leaving another admission rule unsatisfied must not admit it.

This is an interoperability procedure, not a shipped signer or a key-custody
service. Choose or maintain the external approval interface under the reviewer's
control, and test it against the public vectors before using a real key.
The repository includes a standalone reference signer in `examples/external-signer/`
for use outside the vault. It is not a key-custody service. Keep its interface under
the intended key holder's control and test it against the public vectors.

## Capability checks

Expand Down
28 changes: 28 additions & 0 deletions examples/external-signer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Standalone external signer

Copy this directory to a separate signing environment outside the vault. Use
Node 22 or newer and `npm ci --ignore-scripts` there (requires registry access). The only dependency
is the exact `yaml` version in package.json. There are no package scripts.

See the repository guide at
`site/src/content/docs/guides/external-signing.md` for the full workflow.
Run `node signer.mjs keygen --private-key ~/ziggurat-reviewer/reviewer-a.pem --reviewer-id reviewer-a --key-id reviewer-a-2026`.
Run `node signer.mjs sign --vault /vault --page /vault/knowledge/garden.md --private-key ~/ziggurat-reviewer/reviewer-a.pem --key-id reviewer-a-2026 --out receipt.json`.

The key must resolve outside the vault. Location checks guard against mistakes and are not a security boundary. Key generation uses exclusive creation
and mode 0600 where supported. On Windows mode bits are not applied; restrict the key file ACL to the key holder. Configure OS permissions separately. Never expose
the key or signing environment holding it to a model, agent, MCP server, or vault automation. The digest
prompt requires interactive stdin; it does not prove human attention. Review data
and diagnostics go to stderr. Receipt JSON goes to stdout or the requested new
output file. Transfer only that receipt to the vault's indicated authorization path.

Exports are `parsePage`, `validatePage`, `canonicalBytes`, `digest`,
`unsignedReceipt`, `signingPayload`, and `signPage`. `signPage` takes an Ed25519
private KeyObject as its last argument. These exports never prompt or write files.
The example does not import the Ziggurat runtime. Build and read verification
remain the authority on admission, including every other Gold eligibility rule.

The async runSign(options, io) and runKeygen(options, io) exports take stdout and
stderr callbacks and an async confirm(prompt) callback. The CLI supplies the TTY
prompt; signPage remains pure. The display shows every signed field and defaults,
then target path, key ID, full digest and numbered body.
31 changes: 31 additions & 0 deletions examples/external-signer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/external-signer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"ziggurat-reference-external-signer","private":true,"type":"module","engines":{"node":">=22"},"dependencies":{"yaml":"2.9.0"}}
Loading
Loading