Skip to main content

onedoor

onedoor is part of oneproof.

CI PyPI Python License

A decision point for agentic systems: policy, before the action, with a measured record of what it stops and what it misses.

Four calls to onedoor's decision service with their real responses: a €120 transfer permitted, a €450 transfer denied by the daily cap, a payout held for a person and then approved, and the kill switch denying a transfer

A 70-second video of the same walkthrough, with the Studio and the evaluation, is on the 0.11.0 release page.

For reviewers: Project overview · Safety approach · Supporting evidence · Limitations

Why onedoor

Agents with tools act. Under ambiguity, a conflicting constraint, or a tool that fails after it may already have acted, an agent can carry out an action that cannot be undone — and a refusal or an alert written after the fact does not undo it.

onedoor is a decision before the action: written policies with tiers, budgets and effect caps; human approval for actions a policy places in its approval tier (tier 3); single-use permits bound to one action and recipient; the recipient's own signed confirmation that it acted; a kill switch; and a decision receipt for every verdict, signed when a key is configured. It sits between the agent and the systems it acts on:

flowchart LR
    A[agent / model] -->|proposes an action| D[onedoor: decide]
    D -->|permitted| T[the real tool / API]
    D -->|denied| A
    D -->|held| H[a person]
    H -->|approves or denies| D
    T -->|reports the outcome| D

What onedoor is not: not a prompt or output filter on the model (nothing here reads or shapes what the model says); not monitoring after the fact (the decision happens before the tool runs, not as an alert once it has); not a sandbox (it does not isolate or simulate the tool — it decides whether the real one may be called). Each fits beside onedoor, not instead of it: a prompt filter can still catch what a model says before it ever proposes an action; a sandbox can still isolate the tool onedoor has permitted to run.

With onetrace (docs): onedoor decides; a step that takes the action can record which decision allowed it, in a run that anyone can verify offline, signed when a key is configured, with no network call. The two are independent packages with one documented seam (onedoor.guardrail.decision_ref, ot.decision) — see the evaluation's own recording section for a worked example.

Tested against irreversible actions

A scripted, rerunnable evaluation (eval/) built from a published challenge's own failure modes for irreversible autonomous actions: eight categories of agent scenario, each run once against a plain executor that carries out everything proposed, and once through onedoor 0.11.1's real decision API.

category harmful, without onedoor harmful, with onedoor legitimate, wrongly stopped held for a person duplicate effects (without / with)
ambiguity 2 0 0 0 0 / 0
approval 1 0 0 3 0 / 0
conflicting_constraints 3 0 0 0 0 / 0
injected_instruction 3 1 0 1 0 / 0
kill_switch 2 0 0 0 0 / 0
ordinary_work 0 0 0 0 0 / 0
permits 3 0 0 0 0 / 0
tool_failure 2 2 0 0 2 / 2
total 16 3 0 4 2 / 2

two bars per category: harmful actions carried out, without onedoor and with it

Without onedoor, every harmful scenario action is carried out (16 of 16). With onedoor: zero legitimate actions are wrongly stopped, and by default three harmful actions still get through -- kept as findings rather than fixed: a naive retry after a tool timeout moves money or sends a message a second time (the duplicate-effects column; no retry correlation exists yet), and a message to a recipient named by injected text is not stopped by anything that checks who the recipient is (onedoor's policies gate by budget and rate, not by recipient reputation).

When the caller marks the recipient untrusted and the policy lists it in untrusted_params.hold (0.11's opt-in control, eval/RESULTS.md), the harmful actions that get through drop from three to two: this needs the caller to mark the input, so an unmarked call still sees the default behaviour above. The retry-correlation gap is not addressed by this or any other control yet and stays open. Both findings are kept, with the roadmap item that would address each, in eval/FINDINGS.md.

Full table, every scenario's own line, and how to rerun it: eval/RESULTS.md · findings: eval/FINDINGS.md · how to add a scenario and what this measurement doesn't show: eval/README.md. Recorded and verified with onetrace: see below.

pip install -e ".[dev,service]"
python -m eval run

How it works

A decision. Every proposed action is checked against the policy table: tier, numeric bounds, effect caps, and (for an action in the policy's approval tier, tier 3) a requirement to hold for a person. A denial always carries a reason code.

flowchart TD
    P[proposed action] --> K{kill switch engaged?}
    K -->|yes, tier > 0| Deny1[denied: kill_switch]
    K -->|no| L{listed by a policy?}
    L -->|no| Deny2[denied: default_deny]
    L -->|yes| B{bounds, caps ok?}
    B -->|no| Deny3[denied: bounds / budget_exhausted]
    B -->|yes| T{tier}
    T -->|1 or 2| X[executed, reported]
    T -->|3| H[held for a person]

Approval. A tier-3 proposal waits for a person; approved, it executes and reports exactly like an auto-tier action; denied, it is refused with the operator recorded. The principal who proposed an action can never also approve it.

Permits. Where a policy declares one, onedoor issues a single-use, signed permit bound to one action and one recipient -- through the library today; the decision service doesn't issue them yet. The recipient verifies it independently (onedoor.permit.recipient) before acting, and a second presentation of an already-consumed permit for a different instruction is refused, not silently repeated.

The kill switch. Engaged, every tier above a read is denied outright -- never merely queued for later approval. Reads stay exempt, so there is still visibility during an incident.

The decision receipt. Every verdict is one append-only, typed audit row; optionally signed and anchored (onedoor[signed]) so a holder of an export can check, offline, that a decision exists unaltered.

the policies list an uploaded draft the loader would refuse, stopped at the per-rule checks a decision receipt

Install

Requires Python >= 3.12.

python -m venv .venv
.venv\Scripts\activate          # macOS/Linux: source .venv/bin/activate
pip install "onedoor"           # the library alone
pip install "onedoor[service]"  # + the HTTP decision service
pip install "onedoor[studio]"   # + the Studio

Run the flow, end to end

About ten minutes, with the shipped example policies (onedoor/templates/payments/). From a fresh venv:

pip install "onedoor[service]"
python -c "import shutil; from onedoor import templates; shutil.copy(templates.PAYMENTS.policies_path, 'policies.yaml')"
export ONEDOOR_DECIDE_KEYS=dev ONEDOOR_ADMIN_KEYS=root ONEDOOR_DB=onedoor.db ONEDOOR_POLICIES=policies.yaml
python -m uvicorn onedoor.service.app:create_app --factory --host 127.0.0.1 --port 8099

On Windows PowerShell, replace the export line with: $env:ONEDOOR_DECIDE_KEYS="dev"; $env:ONEDOOR_ADMIN_KEYS="root"; $env:ONEDOOR_DB="onedoor.db"; $env:ONEDOOR_POLICIES="policies.yaml"

In another terminal -- a payment allowed, then the same budget exhausted and denied:

curl -s -X POST localhost:8099/v1/decide -H "Authorization: Bearer dev" -H "Content-Type: application/json" -d '{"action_type":"payments.transfer","params":{"amount_eur":120.00,"destination_account":"acct-1"},"source":"llm","rationale":"first look"}'
curl -s -X POST localhost:8099/v1/decide -H "Authorization: Bearer dev" -H "Content-Type: application/json" -d '{"action_type":"payments.transfer","params":{"amount_eur":450.00,"destination_account":"acct-1"},"source":"llm","rationale":"over the daily cap"}'

You should see "decision":"permitted" with an intent_audit_id, then "decision":"denied","reason":"rate_exhausted" or "budget_exhausted".

An action held for approval, then approved:

curl -s -X POST localhost:8099/v1/decide -H "Authorization: Bearer dev" -H "Content-Type: application/json" -d '{"action_type":"payouts.schedule","params":{"batch_id":"b-1"},"source":"llm","rationale":"month end"}'
curl -s localhost:8099/v1/approvals -H "Authorization: Bearer root"
curl -s -X POST localhost:8099/v1/approvals/1/approve -H "Authorization: Bearer root"

The first call returns "decision":"proposed" with an approval_id. The third resolves it, but reads "decision":"dry_run","reason":"dry_run","detail":"would have executed", not a real execution: payouts.schedule's own rule in the shipped template leaves dry_run at its default, true, so the action rehearses at every tier, approved or not.

The kill switch, on and off:

curl -s -X POST localhost:8099/v1/killswitch -H "Authorization: Bearer root" -H "Content-Type: application/json" -d '{"engaged":true}'
curl -s -X POST localhost:8099/v1/decide -H "Authorization: Bearer dev" -H "Content-Type: application/json" -d '{"action_type":"payments.transfer","params":{"amount_eur":10.00,"destination_account":"acct-1"},"source":"llm","rationale":"should be blocked"}'
curl -s -X POST localhost:8099/v1/killswitch -H "Authorization: Bearer root" -H "Content-Type: application/json" -d '{"engaged":false}'

With the switch engaged, the decide call reads "decision":"denied","reason":"kill_switch".

The Studio, reading the same decisions back:

pip install "onedoor[studio]"
python -m onedoor.studio --db onedoor.db --studio-db studio.db

Open http://127.0.0.1:8787. --db must name the same file the service used above.

the live state, with caps the history

The same walkthrough, in PowerShell 5.1

curl is an alias for Invoke-WebRequest there; use curl.exe (the real binary) with --%, PowerShell's stop-parsing token, so embedded double quotes reach the call exactly as written. Run fresh against a live service from the commands above:

curl.exe --% -s -X POST localhost:8099/v1/decide -H "Authorization: Bearer dev" -H "Content-Type: application/json" -d "{\"action_type\":\"payments.transfer\",\"params\":{\"amount_eur\":120.00,\"destination_account\":\"acct-1\"},\"source\":\"llm\",\"rationale\":\"first look\"}"
curl.exe --% -s -X POST localhost:8099/v1/decide -H "Authorization: Bearer dev" -H "Content-Type: application/json" -d "{\"action_type\":\"payments.transfer\",\"params\":{\"amount_eur\":450.00,\"destination_account\":\"acct-1\"},\"source\":\"llm\",\"rationale\":\"over the daily cap\"}"

curl.exe --% -s -X POST localhost:8099/v1/decide -H "Authorization: Bearer dev" -H "Content-Type: application/json" -d "{\"action_type\":\"payouts.schedule\",\"params\":{\"batch_id\":\"b-1\"},\"source\":\"llm\",\"rationale\":\"month end\"}"
curl.exe --% -s localhost:8099/v1/approvals -H "Authorization: Bearer root"
curl.exe --% -s -X POST localhost:8099/v1/approvals/1/approve -H "Authorization: Bearer root"

curl.exe --% -s -X POST localhost:8099/v1/killswitch -H "Authorization: Bearer root" -H "Content-Type: application/json" -d "{\"engaged\":true}"
curl.exe --% -s -X POST localhost:8099/v1/decide -H "Authorization: Bearer dev" -H "Content-Type: application/json" -d "{\"action_type\":\"payments.transfer\",\"params\":{\"amount_eur\":10.00,\"destination_account\":\"acct-1\"},\"source\":\"llm\",\"rationale\":\"should be blocked\"}"
curl.exe --% -s -X POST localhost:8099/v1/killswitch -H "Authorization: Bearer root" -H "Content-Type: application/json" -d "{\"engaged\":false}"

Each reads the same decision as the bash form above. docs/integration-service.md shows the request shapes for the full decide/report/approve/kill-switch API, in both forms, with its own illustrative values -- not this walkthrough's own ten-minute sequence.

Integrate with agent frameworks

Five short, complete, runnable examples, each under its own examples/integrations/<name>/, pinned with hashes in its own requirements-<name>.txt, kept out of onedoor's own dependencies, wheel and sdist. Each has a test that drives it with no model and no network.

  • Plain Python tools (examples/integrations/plain_python/): a decorator wraps a tool function so it calls decide_and_reserve first and report_result after.
  • LangChain (examples/integrations/langchain/, langchain==1.4.2): the shipped OneDoorMiddleware resolves every tool call through onedoor; a denial returns to the agent as the tool's own result, with its reason code. The test drives a real create_agent loop against LangChain's own GenericFakeChatModel.
  • LangGraph (examples/integrations/langgraph/, langgraph==1.2.12): a gate node before the acting node; a tier-3 action holds the graph as a real interrupt(), resumed with Command(resume=...) once a person approves through onedoor.
  • OpenAI Agents SDK (examples/integrations/openai_agents/, openai-agents==0.24.0): a @function_tool-decorated tool, guarded the same way. The test calls it through the framework's own FunctionTool.on_invoke_tool, with no Agent run and no API key.
  • MCP (examples/integrations/mcp/, mcp==2.3.0): an MCP server (the mcp package's own server API) whose tool handler calls onedoor before acting. onedoor.mcp ships a separate gateway that puts every tools/call through decide_and_reserve on its own, through a tool-to-action mapping, over stdio or a scoped streamable-HTTP transport (one JSON-RPC message per request; no session negotiation or server-initiated stream yet).

All four frameworks installed cleanly beside onedoor 0.10.2 (pip check clean); none is parked.

onedoor and onetrace

onedoor decides before an action: policy, tiers, budgets, approvals, a permit. A step that takes an action can record which onedoor decision allowed it. onetrace-verify then checks both sides together — the decision export and the run's own citations of it — with no network call. Full detail on the onedoor side of that record, including the exact shape a citation and a checked permit take, is in docs/onetrace.md.

Record and verify with onetrace

pip install -r eval/requirements-record.txt
python -m eval run --record

Every settling action in the evaluation above is also written as one onetrace run, citing the decision onedoor actually returned right before the simulated tool acts, and checked afterward with onetrace-verify. A --record run's own eval/RESULTS.md gains a line for this: last run, 21 of 21 recorded runs verified PASS (the plain, committed eval/RESULTS.md above never carries this line -- it needs none of onetrace to be read). A scenario where every action is denied, held or refused writes no run -- there is no decision to cite. Full detail, and a plain note on the one onetrace check this evaluation could not demonstrate (the re-run guard, onetrace reproduce --allow-writes), in eval/README.md.

Configuration and operating

The policy vocabulary, the decision service's environment variables, signed receipts, anchoring, and the receipt viewer are documented in docs/ -- start at docs/policy-reference.md and docs/integration-service.md. The ten-page operator manual is docs/OneDoor_User_Manual.pdf.

Limitations and non-claims

onedoor decides on an action as it is described to it. A tool mapped to the wrong action type, or an action described falsely by whatever called decide_and_reserve, is decided as described -- the decision point cannot see past the description it was given.

The evaluation above measures scripted scenarios against onedoor 0.11.1; it is not a claim about every agent, every tool, or every version. A recipient's confirmation shows the recipient said it acted -- not that it did, independent of what it says.

Three gaps the evaluation found and kept, open as of this release (full detail in eval/FINDINGS.md):

  • No retry correlation. A tool that times out after possibly acting, then an uncorrelated retry, can carry out the same effect twice.
  • No recipient check beyond rate and budget. A message action gated only by a daily rate still sends to whatever recipient the call names, including one named by untrusted text. A policy can now list that parameter in untrusted_params and deny or hold the call when the caller marks it untrusted (0.11.0); a call the caller does not mark, or a policy that lists nothing, is unaffected.
  • An expired approval is proposed again, not denied. Presenting an approval after its own expiry re-proposes a fresh approval instead of resolving denied.

A fourth limitation, not something the evaluation discovered but a plain fact about the decision service's current code: bound permits are library-only. The decision service carries no presenter key thumbprint and configures no permit issuer, so a bound permit is issued through the library today, not over the service.

A decimal string in params was refused by a numeric bound -- a conformance defect, ours, fixed in 0.8.0. {"amount_eur": "40.00"} is permitted, exactly like {"amount_eur": 40.00}; {"amount_eur": "abc"} and {"amount_eur": "1e3"} are both refused with "decision":"denied","reason":"bounds", detail "param 'amount_eur' must be numeric: … (got 'abc')" (or '1e3') -- exponent notation is a refused spelling, not merely unparseable.

A longer-standing, measured list -- this defect's own history, numeric precision at the wire boundary, URL pattern evasion, and the rest -- is in CHANGELOG.md and CONFORMANCE.md.

Roadmap

Planned, no dates:

  • Reversibility declared in the policy itself (reversible / compensable / irreversible), rather than inferred from tier alone.
  • An approval left unanswered past its own expiry resolves denied.
  • An unknown tool outcome (a timeout, a failure after the tool may have acted) holds the action until someone settles it, closing the duplicate-effect gap above.
  • Policy conflict checks in the Studio, before ratify.
  • Backtest against onetrace runs: a new policy's verdict, beside what was decided at the time.
  • A recipient allow-list per action, with a held path for a new recipient. A plan can already declare a recipient list for the actions it covers (0.11.0), but only while a plan is active, not as a standing per-action rule; a recipient off that list is simply not matched by the plan, and is decided as usual.

Licence and contributing

Apache-2.0. Issues and pull requests welcome at https://github.com/shamiksaharcciit-oss/onedoor.

Metadata

Release files for onedoor 0.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onedoor 0.11.1
File Size Uploaded Provenance Actions
onedoor-0.11.1.tar.gz 547.9 kB Without provenance Details for onedoor-0.11.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for onedoor 0.11.1
File Interpreter ABI Platform Actions
onedoor-0.11.1-py3-none-any.whl Python 3 none any Details for onedoor-0.11.1-py3-none-any.whl

Total release size: 1.1 MB

Release files / onedoor-0.11.1.tar.gz

Download URL onedoor-0.11.1.tar.gz
Size 547.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1b92e8681c88fbc95ba65d23c43228e8b2d7caa69bad9fbdf9fbe560aa51879d
BLAKE2b-256 checksum
How to use checksums
b66d7bf7a63b9a66c7e788feb7bfec461435147a52ec1a77b8f73be60b661674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / onedoor-0.11.1-py3-none-any.whl

Download URL onedoor-0.11.1-py3-none-any.whl
Size 530.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c683cf110cfee22e2196d9c2be8298008bfda6d2a358169c1c320672b68550b
BLAKE2b-256 checksum
How to use checksums
84d9dbf6950e697c964a92051a2740c13a3b92cbd0802142d3440223fc0fcfd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for onedoor 0.11.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page