Observed since 20 Oct, 22:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Outbound change control for AI agents — gate shell, file-write and HTTP side effects before they happen
Python bindings for execution control at the agent side-effect boundary.
This package provides Python bindings for agent-guard, giving Python hosts a pre-execution decision layer before agent tool calls turn into shell commands or other side effects.
Status: The Python wrapper layer is a beta adapter surface. The clearest current proof point is still shell-first execution control, and Node remains the most mature integration path in the repository.
Integrate agent-guard into your existing LangChain tools with a policy gate in front of the original tool:
from agent_guard import Guard, wrap_langchain_tool
# 1. Initialize the Guard with your security policy
guard = Guard.from_yaml_file("policy.yaml")
# 2. Secure your existing tools
bash_tool = ShellTool() # Your original tool
secured_tool = wrap_langchain_tool(guard, bash_tool, agent_id="researcher")
# 3. Use the tool as normal - agent-guard handles the rest!
secured_tool.run("ls -la")
OpenAI-style handler wrapping is also available:
from agent_guard import Guard, wrap_openai_tool, AgentGuardDeniedError
guard = Guard.from_yaml_file("policy.yaml")
guarded_handler = wrap_openai_tool(
guard,
lambda input_data: {"ok": True, "query": input_data["query"]},
tool="web_search",
mode="check",
trust_level="trusted",
)
try:
print(guarded_handler({"query": "agent-guard"}))
except AgentGuardDeniedError as error:
print("blocked", error.code)
policy.yaml.Current boundary note:
check mode remains a policy-only gate; in auto mode, non-shell
tools use Guard.run(). A Handoff closes its one-shot lifecycle before
returning the original handler result, while Guard-owned WriteFile or
mutating HTTP outcomes may execute without invoking that handlerbash is the owned shell path; shell-like custom IDs such
as shell, terminal, sh, cmd, or powershell fail closed in auto
with UnsupportedShellAlias until explicitly mapped or assigned a modeGuard.execute() / Guard.run() use the SDK default sandbox selection, or accept an explicit backend= keyword ("none", "linux-seccomp", "linux-landlock", "macos-seatbelt", "windows-job-object", "windows-appcontainer"); a backend that is not compiled into the module or not functional on the host resolves truthfully to "none", and an unknown name raisesbackend=, build the module with the matching feature forwarded, e.g. maturin develop --features extension-module,seccomp (requires libseccomp on Linux); the default build carries no sandbox featureNoopSandbox, the policy gate still runs, but OS-level isolation is not equivalentGuardError; a
successful host action whose report fails surfaces AgentGuardExecutionError
with the host result, request ID, attempted handoff result, and an explicit
do-not-retry marker rather than silently returning successThe latest published package is 0.2.6:
python -m pip install agent-guard-python==0.2.6
To test the current 0.2.8 source, install it from a repository checkout
(requires Python and a Rust toolchain):
python -m pip install ./crates/agent-guard-python
The distribution name is agent-guard-python; the import name remains
agent_guard:
from agent_guard import Guard
For local development in this repository:
cd crates/agent-guard-python
maturin develop --features extension-module
pytest tests -v
Check the examples/ directory for full usage scenarios:
demo_langchain.py: Comprehensive 3-line integration demo.provenance_receipt.py: Cryptographic verification example.Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.8 | 7 Oct 2026 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:216ae2666041a5626a1bcb34518a000a3512c146d8e843d489763575ef2f7425