Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

recusal

Latest version: v0.15.1

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
PyPI package Publisher: philip.paz
7 Stars
14 Forks
17 Versions
2.4K Downloads
Python Repo language

Scan summary

recusal was last scanned on 23 Nov 2026 at version 0.15.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 17 versions; the latest 3 were published within 5 days (19–23 Nov 2026).
  • Findings: 1 rule fired in version 0.15.1 (4 instances: 4 medium). The score describes this version only.
  • Downloads: 2,421 downloads.

Versions

17 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.15.1 LATEST 23 Nov 2026 1 rule fired
0.15.0 21 Nov 2026 1 rule fired
0.14.2 19 Nov 2026 1 rule fired
0.14.1 14 Nov 2026 Not shown
0.14.0 12 Nov 2026 Not shown

Rules fired in 0.15.1: 1

Findings

4 Medium

Findings for v0.15.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

Encoded string decodes to a command or instruction

An encoded string in the package decodes, without being run, to a shell command, a network call, a code-execution call or an instruction aimed at an AI agent. The content was hidden from a plain read of the code. Encoding has legitimate uses, so the decoded content needs review.

MEDIUM
Checking access…

🔒 Create a free account to see all 4 findings with descriptions and instance counts

The score describes 0.15.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Recusal

Recusal checks each tool call an AI agent proposes against your policy, and refuses the unsafe or unapproved ones before the tool runs. No model makes that decision; your policy functions do.

It drops into Claude Code as a hook, MCP tool calls included, and gates a Claude Messages API loop or any Python agent loop. For agent frameworks there are eight adapter packages, each tested against its framework: LangGraph, LangChain, the OpenAI API and Agents SDK, Google ADK, CrewAI and Pydantic AI. The kernel has zero runtime dependencies and runs on Python 3.9+.

Website: recusal.io, with an interactive demo of the gate.

On PyPI: recusal, with the eight adapter packages, each published under its own name.

Status: Beta (0.x) and in active development, not a finished or certified security product. The adapters are at different stages of security review, and help is welcome: project status.

What it does not enforce: Recusal judges the tool calls that reach a gate you have installed. It does not stop an agent that can reach a resource another way: a credential with wider rights, a shell or network path outside the governed session, a file it can write that configures the gate, or the Python environment the hook runs in. Use it as one layer of several: least-privilege credentials for the agent, a sandbox or container, limits on its network egress, Claude Code managed settings for the hook configuration, and an audit anchor the writer cannot reach (the limits in full).

Website PyPI CI python license runtime deps

Contents: See it refuse · Works with · Adapters · Status · Install · Policies · MCP · Audit · How it works · CI · Built to be checked · Documentation

New with 0.15.1

  • The audit log gives each sink a copy of its own. AuditLog.append handed the same entry to every sink, to its in-memory mirror and to its caller, so a sink that changed it changed what the others held. Each now gets a separate copy, and the file on disk was never affected: the entry.
  • Releases of all eight adapter packages since 0.15.0, most of them security releases. If you gate one of these frameworks, upgrade its package: recusal-crewai to 0.2.2, recusal-google-adk to 0.2.1, recusal-langchain to 0.2.0, recusal-langgraph to 0.3.0, recusal-openai to 0.2.2, recusal-openai-agents to 0.2.1, recusal-openai-agents-mcp to 0.2.0 and recusal-pydantic-ai to 0.2.0: what changed and why.

Each adapter is on PyPI under its own name and version. Under recusal/, 0.15.1 differs from 0.15.0 in recusal.audit and the version string; the adapters are not part of its wheel. The full list is in the changelog.

See it refuse (20 seconds, no API key, no clone)

pip install recusal
recusal demo

Four scenarios, offline and deterministic: a write to the wrong customer refused before the tool runs, the shipped deny-list refusing rm -rf and its own uninstall while an ordinary command defers, a pinned MCP catalog refusing a post-approval rug pull, and a valid call refused because its delegated authority expired. recusal demo --list names them; --scenario runs one. (Its exit code is not a verdict: recusal verdict is the command whose exit code adjudicates.)

The long form, annotated and worth reading, is in the repository:

git clone https://github.com/philpaz/recusal && cd recusal
python examples/claude_refusal.py   # a Claude agent stages a write to the WRONG
                                    # customer; the gate refuses before the tool runs
python examples/gallery.py          # the same gate across the OWASP agentic failure modes
python examples/mcp_security_demo.py # an approved MCP launch command changes; verification
                                     # refuses BEFORE the substituted command executes

Deterministic and offline: the same normalized evidence and explicit policy inputs, under the same recusal implementation version, produce the same verdict, including the no.

Works with

The core is plain Python with no dependencies, so it gates any agent loop that lets you check a tool call before it runs. Each row says how far that is proved today: Tested means a runnable example with its own tests in this repository's CI. Coming links the pull request or claimed issue where the work is happening. Wanted links an open issue nobody has taken yet: comment there to pick it up.

Runtime Status Where
Claude Code, including MCP tools Tested PreToolUse hook, MCP
MCP servers: pin approved tools, detect drift Tested examples/mcp_governance.py
Claude Messages API, manual loop Tested examples/claude_refusal.py
LangGraph ToolNode, sync and async Tested examples/langgraph_gate.py
Any Python agent loop Tested examples/agent_loop.py
LangChain create_agent middleware, sync and async Tested examples/langchain_agent_gate.py
LangChain create_agent audit trail Tested examples/langchain_agent_audit.py
OpenAI Agents SDK, function tools Tested examples/openai_agents_gate.py
OpenAI Agents SDK audit trail, function tools Tested examples/openai_agents_audit.py
LangGraph audit trail Tested examples/langgraph_audit.py
LangGraph pause, resume and replay Tested examples/langgraph_gate.py across interrupt(), Command(resume=) and checkpoint replay
OpenAI Agents SDK, MCP tools, local servers and hosted MCP Tested examples/openai_agents_mcp_gate.py
OpenAI Agents SDK audit trail, MCP tools Tested examples/openai_agents_mcp_audit.py
OpenAI Responses and Chat Completions, your own loop Tested examples/openai_responses_gate.py
OpenAI Responses and Chat Completions audit trail Tested examples/openai_responses_audit.py
Google ADK LlmAgent, callback and plugin Tested examples/google_adk_gate.py
Google ADK audit trail Tested examples/google_adk_audit.py
CrewAI tool-call hooks Tested examples/crewai_gate.py
CrewAI audit trail Tested examples/crewai_audit.py
Pydantic AI Agent, capability and hook Tested examples/pydantic_ai_gate.py
Pydantic AI audit trail Tested examples/pydantic_ai_audit.py
OpenAI Codex CLI, PreToolUse hook Coming #290
LlamaIndex Wanted #109

xAI documents its Grok API as using the same request formats as OpenAI's, so #81 is also where Grok support will start. Want a runtime that isn't listed? Open an issue.

What no local gate can see. Some tools run on the model provider's servers, such as hosted web search, a hosted code interpreter or hosted MCP. Those calls never pass through your code, so neither Recusal nor any other local gate can refuse them. The one exception is a hosted call the provider asks your code to approve first: the OpenAI Agents SDK's hosted MCP approval callback is such a point, and examples/openai_agents_mcp_gate.py gates it, for the calls that are sent for approval and no others.

The kernel and its adapters

The thing that generates the work must never certify it.

Recusal is built the way it asks you to build: the part that decides is kept apart from the part that does. recusal is the kernel. It holds the verdict, the audit log and the MCP pinning, and it depends on nothing. Each agent framework gets its own small package that carries a tool call from that framework's hook to the kernel and carries the answer back. An adapter has no verdict of its own: it refuses a call it cannot present to the kernel faithfully, and for every other call the kernel's decision is the decision. The kernel never imports an adapter.

An arrow means "depends on". No arrow leaves the kernel, so a framework's breaking change is answered by a release of that framework's adapter, not by a release of the kernel.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases recusal

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PHP2Shell, Day 5 93.6% of Measurable Instances Still Unpatched (1)
Vulnerability Insights

PHP2Shell, Day 5: The Panic Hasn’t Turned Into Patching

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Frame 2085668439 (1)
Group 1261154229