
Occasio
io.github.occasiolabs由 GitHub 帳號 occasiolabs 發布v0.10.0更新於 Oct 24, 2026
Tamper-evident, Sigstore-signed audit trail for Claude Code agents.
概覽
一個本機代理,用於稽核並依政策管控 AI 程式代理的工具呼叫,產生防竄改、可選 Sigstore 簽章的日誌。
- 可以做什麼
- Occasio 位於程式代理與 Anthropic API 之間,攔截每一次工具呼叫並套用一份人類可讀的政策檔。它對每次呼叫做出 LOCAL、PASS、BLOCK 或 TRANSFORM 決定,從工具輸出中遮蔽密鑰,並把每個事件附加到 SHA-256 雜湊鏈稽核日誌。它也能為某次執行產生簽章行為證明、打包成可攜式的證據檔案、在鏈上執行異常偵測,並在本機瀏覽器介面顯示外送流量。
- 適用情境
- 當你想查看或限制程式代理傳送給模型的內容、阻止密鑰外洩與身分借用(例如 ssh 或雲端指令),或為 CI 與合規執行產出可驗證的代理行為證據時,適合使用。
- 執行需求
- 需要 Node.js 18 或更新版本;需要 Claude Code 等程式代理,或任何遵循 ANTHROPIC_BASE_URL 的代理。Python 3 與 sigstore-python 為獨立驗證器的選項。以 npm 套件 @occasiolabs/occasio 安裝並作為本機程序執行;未宣告需要帳號或 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Occasio,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Occasio
Local-first audit chain and identity gate for AI coding agents. Your prompts, your tool calls, your audit log; all on your machine, cryptographically verifiable later — and an agent may request an identity (ssh / cloud / root), not silently assume one.
Occasio is a local proxy that sits between your AI coding agent (Claude Code, Cline, or anything that talks to the Anthropic API) and whichever LLM endpoint you configured. Every tool call passes through one human-readable policy file you control. You can see what is leaving your machine in real time, block what should not happen, and end up with a tamper-evident hash-chained log that a third party can verify offline months later if you ever need to prove what your agent did.
Nothing about Occasio sends data to a third party. There is no Occasio cloud, no Occasio account, no telemetry. Read docs/WHY-LOCAL.md for the architecture, docs/COMPARE.md for how this differs from cloud-hosted AI observability tools, and docs/SUSTAINABILITY.md for how a local-first product is funded under Apache 2.0.
Screenshot: occasio eyes --demo against synthetic data — no real paths, no real traffic. The "(demo)" badge top-left is always shown in demo mode.
The first three demos run against synthetic data so you can see the full pipeline in seconds with no external dependencies. The fourth spawns a real Claude Code subordinate under your Anthropic login (bundled auth — no API key required) and proves the defense end-to-end. Start with demo audit — it answers the only question that actually matters: "prove what your AI agent did in CI."
Identity gate — request, don't assume
The incident this was built for: an agent is asked only for a deploy command, but on its own it sshes into the server and reads env. The strict policy stops exactly that — an AI agent may request an identity, it may not silently assume one.
- Exfiltration is denied, tool-agnostically.
printenv,cat .env,/proc/self/environ, private-key reads,grep-for-secret-names — blocked no matter which command or tool reads them; the output never reaches the model. - Identity borrows need a human.
ssh/scp,az/ the cloud control plane,sudo/systemctl— a fail-closed BLOCK with a "requires human approval" refusal the agent cannot satisfy on its own. - The handshake distinguishes who is who. The agent requests; you authorize once, out-of-band, from your own terminal:
The agent cannot self-approve: the approval control plane is in its deny-zone and the token is HMAC-signed. The chain records actor=ai_agent · delegator=you · approved_by=you. A second, non-proxied enforcement point — a PreToolUse hook (occasio hook --install) — covers execution that doesn't pass through the proxy.
Full design, threat model, and the honest residuals (runtime indirection, egress): docs/identity-gate.md.
Two ways to use it
Most people land here for one of these — pick the column that fits and skim accordingly.
Both views read the same underlying log. You don't have to pick one — running the proxy gives you both for free.
Quickstart
New here? The 5-minute Getting Started guide walks the identity-gate flow end to end — install →
init --template strict→ run your agent → approve a borrow → verify the log. Every command in it is tested against the published release.
Requires Node.js ≥ 18. Works on Windows, macOS, Linux.
After the alias is registered, every claude invocation routes through Occasio transparently. Audit-chain rows accumulate at ~/.occasio/pipeline-events.jsonl.
Inspect the run:
Command matrix
Grouped by what you're doing. (stable) = load-bearing with test coverage; (beta) = works end-to-end, narrower; (alpha) = scaffold. Full list: occasio help.
Evidence workflow
Produce one file an auditor or CI receives and checks in a single command:
verify checks the schema, the manifest hashes, the chain slice integrity, the
policy binding, the git-state vs chain cross-check, and the Sigstore signature
when present — all against data embedded in the file (never the producer's
machine). The run is bound to the concrete code it touched via git_state rows
(HEAD + diff hash + changed files). Signing is optional; an unsigned bundle still
verifies everything else. Bundles embed absolute producer paths — an
internal-audit artifact; review before sharing publicly. → docs/VERIFY.md
Policy workflow
~/.occasio/policy.yml governs the Occasio-controlled path: secret handling,
deny_paths/allow_paths, custom deny_patterns, per-round limits, and tool
routing. Approve it and pin against drift:
Scanner & preflight
scan never prints the secret in plaintext (masked snippet + SHA-256). preflight simulate runs candidate actions through the same policy engine the runtime
uses and shows the matched rule + how to unblock for anything it would block.
→ docs/SCAN.md · docs/PREFLIGHT.md
Verify the local-first claim
Scans the installed source for every outbound network primitive, classifies each callsite, checks for telemetry SDK signatures, and surfaces the audit chain status. Exits non-zero if any critical finding appears. JSON output via --paranoid --json. See docs/WHY-LOCAL.md for the architecture this verifies.
Where Occasio sits alongside SLSA Provenance and CycloneDX AI-BOM: docs/SUPPLY-CHAIN-TRIANGLE.md. Occasio is the runtime behavioral leg.
Live visibility — for developers
The audit chain and signed attestations answer "what did the agent do, prove it" — the auditor's question. Sometimes you also want the simpler one: "what is the agent doing right now?" What is leaving your machine in this HTTP request. Which files have already gone to Anthropic in this session. What the system prompt looks like. What got redacted before it shipped.
occasio eyes is a local browser UI on http://127.0.0.1:3002 that shows exactly that. Capture is opt-in via --eyes on the proxy; nothing leaves the machine, all storage stays under ~/.occasio/eyes/.
What you see:
- Sidebar grouped by user prompt — one "read the readme" expands into the 3–6 HTTP round-trips it actually took (Claude Code's agentic loop made visible).
- Session sparkline + per-file aggregate — outbound size over time, which files have been sent to the cloud and how often.
- Per-exchange byte-decomposition — stacked bar showing system / history (replay) / new-this-turn / tools-framing. The "small" request that's 124 KB is suddenly explainable: 108 KB of it is the same system prompt every time.
- Tabs: Request · Response · Tools (full local tool outputs — Read/Glob/Grep/Bash bytes that the interceptor handled locally and never sent up) · Diff (pre-transform vs sent — see the literal secrets that were redacted, in the clear, locally) · Headers · Raw SSE bytes · Stats.
- Live flash overlay when a new outbound lands — useful both for understanding and for demos.
Screencast-safe view — --sanitize
Recording a demo or screenshot of occasio eyes against a real session normally
leaks your identity: home path (C:\Users\<you>\...), OS username, git email,
real name, hostname. The --sanitize flag replaces those with deterministic
pseudonyms in the display only — disk contents under ~/.occasio/eyes/ are
unchanged so your audit trail stays real.
In the browser UI a cyan dot and (sanitized) badge confirm it's active.
Paths like C:\Users\<you>\Desktop\proj become /home/user-7c/Desktop/proj,
stable within a session.
What --sanitize covers: $HOME paths, OS username, git user.email /
user.name, hostname, and identity-carrying env vars (USER, USERNAME,
LOGNAME, HOME, USERPROFILE).
What it does not cover — review before sharing:
- Project paths outside
$HOME(e.g.D:\Work\Acme\…) - Git remote URLs in tool outputs (
github.com:org/repoleaks the org name) - File contents — your name in a comment, commit message, or README is not auto-detected. Sanitize keys off identity values it can discover from the OS and git, not arbitrary substrings.
- The Claude Code TUI banner ("Welcome back X", organization line) — that prints before any HTTP traffic and bypasses Eyes entirely. Crop it from the screencast manually.
The flag is a display filter, not a recording mode. The same Eyes capture
can be replayed unsanitized later (just run occasio eyes without the flag).
Dashboard vs. Eyes
Both run as local browser UIs but answer different questions:
Both live on 127.0.0.1 only. No CORS, no auth, no external network.
Commands
Session-level overrides on top of policy.yml:
What it does, in four layers
Under the hood, four layers do the work — Layers 1–2 every run, Layers 3–4 when you ask for an attestation or run the detectors.
Layer 1 — Tool-call interception. A local proxy sits between the agent and the Anthropic API. Read, Glob, Grep, TodoRead/TodoWrite run in-process on your machine; the file bytes never enter the outbound request. A curated set of read-only shell commands (git status, git log --oneline -N, with or without git -C <path>, plus echo / cd cwd-prefix chains) are also executed in-process. Other shell reads (cat <file> and similar) are policy-analyzed for embedded read paths so deny_paths enforces consistently, but the command itself executes server-side via the Bash tool.
Layer 2 — Policy enforcement. Every tool call hits one decision: LOCAL / PASS / BLOCK / TRANSFORM, driven by policy.yml. deny_paths is enforced on the realpath-resolved absolute path so symlinks and traversal variants resolve to the same denial. block_secrets_in_tool_results redacts API keys and JWTs out of any tool output before it re-enters the prompt. Hot-reload: edits to policy.yml take effect on the next call, with a policy_loaded row written to the audit chain. The strict template adds the identity gate — deny_commands block exfiltration behaviours (env dumps, secret-name greps) and identity_approval gates identity borrows (ssh / az / sudo) behind a single-use, human-approved token (see Identity gate).
Layer 3 — Behavioral attestation. occasio attest --run-id <uuid> produces a self-contained JSON predicate that commits to the full audit-chain slice for one agent session: every tool call, every block, every transform, every redacted secret, plus the active policy's SHA-256 hash and rules digest. --sign wraps it in an in-toto Statement v1 and Sigstore-signs it using GitHub Actions OIDC (no key management). The predicate type URI is agent-attestation/v1. Two independent reference verifiers ship — Node (occasio attest verify) and Python (docs/attest_verify.py) — and the test suite asserts they agree byte-for-byte on the same payload.
Layer 4 — Anomaly detection (EDR). occasio anomalies runs four detectors over a time window of the audit chain: deny-rate spike, file-read-volume burst, previously-unseen tool-input shape, secret-redaction-rate spike. Severity escalates against your historical baseline — roughly a ×10–×20 ratio above normal triggers HIGH at the detector level; against a sparse normal baseline the observed multipliers in practice land between ×100 and ×1000. See docs/edr-demo.md for the reproducible defense-in-depth walkthrough.
Architecture
Verification
Three independent checks, all required for a verified attestation:
- Sigstore signature — Fulcio certificate chain + Rekor inclusion proof. Verifiable by any sigstore-conformant tool (
cosign verify-blob,sigstore-js,sigstore-python). - DSSE payload ↔ attestation predicate equivalence — re-decode the in-toto Statement inside the bundle, canonicalise the predicate via RFC 8785 subset, compare byte-for-byte with the attestation predicate (minus the
signaturemetadata field). - Audit chain integrity — SHA-256-walk every
prev_hash → hashlink from the GENESIS sentinel, then assert the attestation'sfirst_hashandlast_hashappear in the chain in the right relative order.
Two reference verifiers ship side by side:
- Node:
occasio attest verify <file> - Python:
python docs/attest_verify.py <file>— stdlib + optionalsigstore-python, reusesdocs/audit_walker.pyfor the chain step. Seedocs/python-verifier.md.
Cross-language invariant (asserted in the test suite as xlang: and xlang-float: cases): both verifiers agree byte-for-byte on the predicate-equivalence and audit-chain steps for the same payload, including tamper-detection cases. Non-integer numbers are rejected by both canonicalize implementations so a future schema cannot silently introduce divergence.
The Sigstore signature step uses the standard DSSE-wrapped in-toto Statement format; any sigstore-conformant tool verifies it (cosign verify-blob, sigstore-js, sigstore-python). The test suite mocks the signing path; a real-OIDC end-to-end signed-and-verified round-trip requires a GitHub Actions environment and is exercised by the integrations/attest-action/ workflow in CI.
A third partial verifier runs in-browser at integrations/attest-view/ for drag-and-drop inspection. The browser performs the predicate-equivalence and audit-chain steps but defers Sigstore certificate-chain verification to one of the two CLIs (bundling Fulcio/Rekor trust roots in-browser is intentionally not done; the page is explicit about it).
Why now
Three regulatory drivers, all converging on the same requirement: runtime evidence of AI-agent behavior must be cryptographically verifiable.
- EU AI Act Art. 12 mandates comprehensive automated logging of high-risk AI systems. In effect from 2026 for regulated sectors.
- NIST AI RMF (GOVERN, MEASURE, MANAGE families) is becoming required in US Federal procurement and is influencing FedRAMP AI controls.
- SOC 2 Common Criteria are extending to AI-agent controls — auditors at major firms started asking "show me the agent's tool-call log" in 2026 audits.
There is currently no off-the-shelf product producing a signed, third-party-verifiable artifact for what an AI coding agent did inside your CI. Occasio fills that gap with an open schema (Apache-2.0) and ships the reference implementations for it.
Log format
All data is stored locally at ~/.occasio/:
The audit-chain row schema is documented in docs/AUDIT.md. Each row carries prev_hash and hash (SHA-256 hex), with the first row chained from a fixed GENESIS sentinel (64 zeros). occasio audit verify and docs/audit_walker.py are independent implementations of the walker.
Demos
- EDR defense-in-depth — real Claude Code attacking a denied path under your policy, all blocks held, EDR fires HIGH ×100–×1000 over baseline. Reproducible in <2 minutes.
- Reference Pipeline — PR with AI-agent → GitHub Action signs attestation via Sigstore keyless → Check Run on the PR → independent verification offline.
- Cross-protocol governance — the same
deny_pathsrule producing identicalBLOCKrows under Claude Code's HTTP proxy and the MCP server.
Reference
spec/agent-attestation/v1/README.md— predicate type specificationschemas/agent-attestation-v1.json— authoritative JSON Schemadocs/AUDIT.md— audit-chain row schema and canonical-serialisation rulesdocs/compliance-mapping.md— SOC 2 Common-Criteria mappingdocs/python-verifier.md— independent Python verifierdocs/edr-demo.md— defense-in-depth walkthroughdocs/reference-pipeline.md— end-to-end CI pipelineintegrations/attest-action/— GitHub Action that signs + posts a Check Runintegrations/attest-view/— static browser viewer for attestation files
Requirements
- Node.js ≥ 18
- Claude Code (
npm install -g @anthropic-ai/claude-code) — or any agent that respectsANTHROPIC_BASE_URL - Python 3 (optional) — required for the independent verifier and LAO context trimming
sigstore-python(optional) — adds the cryptographic Sigstore step to the Python verifier
License
Occasio is open source under the Apache License 2.0, including an explicit patent grant for safe enterprise use. Versions 0.6.6 and earlier were released under the MIT License and remain MIT in perpetuity for those releases.
Contributions are accepted under Apache-2.0; please sign off your commits per the DCO (git commit -s).
來源:README.md,提交 037f174
工具
0版本歷史
1- v0.10.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分