{"_id":"@arbiterhq/gate","name":"@arbiterhq/gate","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@arbiterhq/gate","version":"0.1.0","description":"Arbiter Authority Gate — MCP stdio adapter into existing /gateway observe + evaluate APIs","license":"MIT","author":{"name":"Arbiter"},"type":"module","bin":{"arbiter-gate":"dist/index.js"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=18"},"scripts":{"build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit","test":"node --import tsx/esm --test 'src/**/*.test.ts'","prepublishOnly":"npm run build"},"dependencies":{"@arbiterhq/sdk":"^0.3.4","@modelcontextprotocol/sdk":"^1.12.1","commander":"^13.1.0"},"devDependencies":{"@types/node":"^22.15.21","tsup":"^8.5.0","tsx":"^4.23.0","typescript":"^5.8.3"},"keywords":["arbiter","mcp","authority-gate","ai-agents","control-plane","stdio","runtime-governance"],"homepage":"https://arbitertrust.com","bugs":{"url":"https://github.com/sumitbirru1-halo/arbiter-sdk/issues"},"repository":{"type":"git","url":"git+https://github.com/sumitbirru1-halo/arbiter-sdk.git","directory":"packages/gate"},"publishConfig":{"access":"public"},"gitHead":"82f08601f9c2fc7c16f002fbf95076f710073641","_id":"@arbiterhq/gate@0.1.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-zFRk0OH2+c0OVY2LIvyS1GTQA2nsGHhPTaaCUeuc1PgDbmxRbmjoJtz5RSUNmt0vw36WwTPs7TiuPmPCcSwtAw==","shasum":"f1f5b6947c4fe0f41b0c6cb651455d3f98f2e129","tarball":"https://registry.npmjs.org/@arbiterhq/gate/-/gate-0.1.0.tgz","fileCount":8,"unpackedSize":34730,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIALhPNegFfMQq294I6OkfEMQOgYxntVW1KIy1SsNQ/+oAiBqyaYcg05G7Y5NIc44cr+6WYHvHU8WByqIyZsh/QFaVw=="}]},"_npmUser":{"name":"arbitertrust","email":"founder@arbitertrust.com"},"directories":{},"maintainers":[{"name":"arbitertrust","email":"founder@arbitertrust.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gate_0.1.0_1784713079422_0.4152592919875997"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-22T09:37:59.299Z","0.1.0":"2026-07-22T09:37:59.564Z","modified":"2026-07-22T09:37:59.743Z"},"maintainers":[{"name":"arbitertrust","email":"founder@arbitertrust.com"}],"description":"Arbiter Authority Gate — MCP stdio adapter into existing /gateway observe + evaluate APIs","homepage":"https://arbitertrust.com","keywords":["arbiter","mcp","authority-gate","ai-agents","control-plane","stdio","runtime-governance"],"repository":{"type":"git","url":"git+https://github.com/sumitbirru1-halo/arbiter-sdk.git","directory":"packages/gate"},"author":{"name":"Arbiter"},"bugs":{"url":"https://github.com/sumitbirru1-halo/arbiter-sdk/issues"},"license":"MIT","readme":"# @arbiterhq/gate — Arbiter Authority Gate\n\n**Current package:** `@arbiterhq/gate@0.1.0` (requires `@arbiterhq/sdk@^0.3.4`).\n\nMCP stdio **adapter** into Arbiter’s existing `/gateway` APIs.\n\nIt does **not** decide. The frozen evaluation waterfall does.\n\n```\nAgent (MCP client)\n  → arbiter-gate (stdio MCP server)\n    → POST /gateway/tools/observe   (tools/list)\n    → POST /gateway/tool-call/evaluate (tools/call)\n      → EvaluationService (identity → … → approval → release → audit)\n    → [opt-in] SDK completeHeldEvaluation (wait → consume)\n    → upstream MCP server (only on ALLOW / after consume ALLOW)\n```\n\nCanonical architecture: **ADR-003** (Authority Gate approval lifecycle) — Gate is a transport adapter; HOLD completion uses SDK `completeHeldEvaluation` only.\n\n## Install\n\n```bash\nnpm install -g @arbiterhq/gate\n# or from monorepo\ncd packages/gate && npm install && npm run build && npm link\n```\n\nRequires prior `arbiter login` (or `ARBITER_API_KEY` + optional `ARBITER_BASE_URL` / `ARBITER_APP_URL`).\n\nOptional env:\n\n| Variable | Default | Meaning |\n|---|---|---|\n| `ARBITER_GATE_HTTP_TIMEOUT_MS` | `30000` | AbortSignal timeout for Arbiter HTTP calls |\n| `ARBITER_GATE_WAIT_FOR_APPROVAL` | off | ADR-003 Beta: wait + SDK `completeHeldEvaluation` then forward |\n| `ARBITER_GATE_APPROVAL_TIMEOUT_MS` | `300000` | Max wait for human approval when wait mode is on |\n| `ARBITER_GATE_APPROVAL_POLL_INTERVAL_MS` | `1000` | Poll interval while waiting |\n\n## Usage\n\n```bash\narbiter-gate --agent my-agent -- node ./examples/demo-mcp-server.mjs\n\n# ADR-003 Beta — continue after Approve inside the same tools/call\narbiter-gate --agent my-agent --wait-for-approval -- node ./examples/demo-mcp-server.mjs\n```\n\nPoint your MCP client at this process instead of the upstream server.\n\nOn `tools/list`, tools are observed and an Authority Map URL is printed to **stderr**.\n\nOn `tools/call`:\n\n| Decision | Default behavior | With `--wait-for-approval` |\n|---|---|---|\n| ALLOW | Forwarded to upstream | Same |\n| HOLD (approval) | Blocked; Why-held + `approvalRequestId` | Wait via SDK `completeHeldEvaluation`, then forward |\n| HOLD (discovery) | Blocked; Authority Map | Same (no wait — adopt first) |\n| DENY | Blocked; Why-held | Same |\n\n## Expected behaviors (intentional)\n\n### Observe soft-open (`tools/list`)\n\nIf `POST /gateway/tools/observe` fails (network, auth, etc.), Gate still returns the upstream tool list to the agent and prints a stderr warning.\n\n**Why:** Inventory soft-open keeps the agent usable during transient API issues. **Enforcement remains on `tools/call`** via `/gateway/tool-call/evaluate`. Soft-open does **not** bypass governance of execution.\n\n### ALLOW vs upstream failure\n\nArbiter may return ALLOW (authorization recorded) and then the upstream MCP `tools/call` may still fail. Gate returns an MCP error explaining that authorization succeeded but upstream execution failed. This is authorize-then-forward behavior — not a policy bypass.\n\n### Approval lifecycle (ADR-003)\n\nGate remains a **transport adapter**. When wait mode is enabled, it does **not** implement release/policy/approval logic. It calls `@arbiterhq/sdk` `ArbiterRuntime.completeHeldEvaluation`, which sequences public runtime APIs only (`waitForApproval` → `consumeRelease` → optional receipt).\n\nGate **must not** call `waitForApproval` / `consumeRelease` directly.\n\nDefault (wait mode off): HOLD ends the MCP `tools/call`. Completing the golden path uses Dashboard Approve + SDK `completeHeldEvaluation` (or the low-level wait+consume APIs). The CLI does **not** consume releases.\n\n### Fingerprint identity\n\nStdio server fingerprints include `command`, `args`, and resolved `cwd` so the same package launched from different directories does not collide.\n\n## Constitution\n\n- Additive / Adapter only — does not replace Discovery, Runtime, Approvals, or Receipts\n- Reuses existing `/gateway/*` endpoints — no new decision APIs\n- No Gate-specific domain tables or local policy engine\n- Lifecycle orchestration only via SDK primitive (**ADR-003**)\n\n## Demo wow path\n\nSee [AUTHORITY_GATE_WOW_DEMO.md](./AUTHORITY_GATE_WOW_DEMO.md).\n","readmeFilename":"README.md","_rev":"1-adefd6bb939cfb420267515f82b196b8"}