This release is a pre-release and may not be stable for production use.
agent-hooks (Python SDK)
Python implementation of
AGENT-HOOKS-0.1:
interception-point enums, AgentContext builder, Verdict types, host-side
InterceptionEmitter with the four composition profiles, the pluggable
identity-provider seam, and the Conformance Test Kit.
Trust model. agent-hooks is a cooperative contract, not a security boundary: the host framework is fully trusted, interceptors run in-process with full data access, and no complete-mediation claim is made. Read SECURITY.md and spec §1.4 before relying on it.
# The 0.1.0a1 artifact on PyPI implements a superseded draft — until
# 0.1.0a2 is published, install from source:
pip install "agent-hooks-sdk[ctk] @ git+https://github.com/responsibleai/agent-hooks.git#subdirectory=sdk/python"
# import name: agent_hooks
Host (framework adapter) usage
from agent_hooks import AgentContextBuilder, InterceptionBlocked, InterceptionEmitter
builder = AgentContextBuilder(agent_id="my-agent", framework="my-fw", session_id="s-1")
emitter = InterceptionEmitter().register(MyPolicy())
await emitter.emit(builder.agent_startup(tools_registered=["http_get"]))
ctx = builder.pre_tool_call(call_id="tc-1", name="http_get", args={"url": url})
try:
await emitter.emit(ctx)
except InterceptionBlocked as e:
return tool_error(e.result.verdict.reason)
result = invoke_tool(ctx["tool_call"]["args"]) # post-transform args
Interceptor usage
from agent_hooks import AgentContext, Verdict
class MyPolicy:
def intercept(self, ctx: AgentContext) -> Verdict:
if ctx["interception_point"] == "pre_tool_call" and ctx["tool_call"]["name"] == "rm":
return Verdict.deny(reason="dangerous")
return Verdict.allow()
Verdict.allow(), Verdict.deny(...), Verdict.warn(...) (allow + recorded
warning) and Verdict.escalate(...) (liftable deny for the approval seam, §9)
are the constructor shortcuts for the §5 shapes.
Running the CTK against your framework
Implement agent_hooks.ctk.Harness (see
conformance/HARNESS.md),
then:
pytest --agent-hooks-harness=my_pkg:MyHarness
The vectors ship inside the wheel; pass --agent-hooks-vectors=<dir> only to
run a different vector set.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_hooks_sdk-0.1.0a5.tar.gz.
File metadata
- Download URL: agent_hooks_sdk-0.1.0a5.tar.gz
- Upload date:
- Size: 130.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ae452b0a1d51540a1b74b0005b0a51f75fd4b80e9aca1a7403dece4dd6f9e46
|
|
| MD5 |
d6d6fba6c832385e44750b7ea9dd2851
|
|
| BLAKE2b-256 |
33f4191de0300a73b9a78f2914e0e497c96e6ac38db457e20f74fdd6251792c4
|
Provenance
The following attestation bundles were made for agent_hooks_sdk-0.1.0a5.tar.gz:
Publisher:
release.yml on responsibleai/agent-hooks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_hooks_sdk-0.1.0a5.tar.gz -
Subject digest:
4ae452b0a1d51540a1b74b0005b0a51f75fd4b80e9aca1a7403dece4dd6f9e46 - Sigstore transparency entry: 2365841772
- Sigstore integration time:
-
Permalink:
responsibleai/agent-hooks@61952932e52d5dab091a64677f19272daae619f8 -
Branch / Tag:
refs/tags/v0.1.0-alpha.5 - Owner: https://github.com/responsibleai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@61952932e52d5dab091a64677f19272daae619f8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: agent_hooks_sdk-0.1.0a5-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 479.9 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
777a4cd3803710277e77d9c6abb6d1a2c9d6ce8977167fe47fc57b8e4ff8bc75
|
|
| MD5 |
51fe9b1e17594d796b722b747b44601f
|
|
| BLAKE2b-256 |
6ec2d2bb3772abe3b04fc841bc6c667f49adf9ae037c945cbe0d6a8739d419c4
|
Provenance
The following attestation bundles were made for agent_hooks_sdk-0.1.0a5-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on responsibleai/agent-hooks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_hooks_sdk-0.1.0a5-cp310-abi3-win_amd64.whl -
Subject digest:
777a4cd3803710277e77d9c6abb6d1a2c9d6ce8977167fe47fc57b8e4ff8bc75 - Sigstore transparency entry: 2365841936
- Sigstore integration time:
-
Permalink:
responsibleai/agent-hooks@61952932e52d5dab091a64677f19272daae619f8 -
Branch / Tag:
refs/tags/v0.1.0-alpha.5 - Owner: https://github.com/responsibleai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@61952932e52d5dab091a64677f19272daae619f8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 649.0 kB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b53cce9dabf1ee8ffffa4b5f6c6d34d269daa699d468e49fad286f0070d23f
|
|
| MD5 |
e89d722ff729f984444f505f32f70ca3
|
|
| BLAKE2b-256 |
5b22ab5cf6e7fd26e8157637eea4b72a903d1b98dad11872857f32ead29ddcd0
|
Provenance
The following attestation bundles were made for agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on responsibleai/agent-hooks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
a4b53cce9dabf1ee8ffffa4b5f6c6d34d269daa699d468e49fad286f0070d23f - Sigstore transparency entry: 2365842330
- Sigstore integration time:
-
Permalink:
responsibleai/agent-hooks@61952932e52d5dab091a64677f19272daae619f8 -
Branch / Tag:
refs/tags/v0.1.0-alpha.5 - Owner: https://github.com/responsibleai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@61952932e52d5dab091a64677f19272daae619f8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 626.2 kB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0946af422eadeb3a192a7a856bc40e2b74435ab540dd3586c3cb7939157c91b
|
|
| MD5 |
e4ce90156b1d10bebdc73ceafd135270
|
|
| BLAKE2b-256 |
2e6d169997cb8ad39fc295854ed25f21171e800298e73e5a12123d3b008149f7
|
Provenance
The following attestation bundles were made for agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on responsibleai/agent-hooks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
a0946af422eadeb3a192a7a856bc40e2b74435ab540dd3586c3cb7939157c91b - Sigstore transparency entry: 2365842483
- Sigstore integration time:
-
Permalink:
responsibleai/agent-hooks@61952932e52d5dab091a64677f19272daae619f8 -
Branch / Tag:
refs/tags/v0.1.0-alpha.5 - Owner: https://github.com/responsibleai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@61952932e52d5dab091a64677f19272daae619f8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 570.5 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb1d714ed6baf884525a153821d909fb23c2fe27e63f61ae254f06ee6ec351d4
|
|
| MD5 |
56137d7311f64bb99262ffb523b0f945
|
|
| BLAKE2b-256 |
14adfe8885b3f3f203d48dba46034d3c92dfd207a9bc504d4ba1356bf57f9234
|
Provenance
The following attestation bundles were made for agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on responsibleai/agent-hooks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
fb1d714ed6baf884525a153821d909fb23c2fe27e63f61ae254f06ee6ec351d4 - Sigstore transparency entry: 2365842771
- Sigstore integration time:
-
Permalink:
responsibleai/agent-hooks@61952932e52d5dab091a64677f19272daae619f8 -
Branch / Tag:
refs/tags/v0.1.0-alpha.5 - Owner: https://github.com/responsibleai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@61952932e52d5dab091a64677f19272daae619f8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 598.9 kB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d63893d94ccfbdc6422dd217663ed88aedec0ffd560ecfa105187fa9bda79063
|
|
| MD5 |
b66d1fd4c88da571a5959503fe6eb2b6
|
|
| BLAKE2b-256 |
d750a6bea9691ef69be1c9c70420e84f773ee721c7e60dafc76069564ba88cc9
|
Provenance
The following attestation bundles were made for agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on responsibleai/agent-hooks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
d63893d94ccfbdc6422dd217663ed88aedec0ffd560ecfa105187fa9bda79063 - Sigstore transparency entry: 2365842203
- Sigstore integration time:
-
Permalink:
responsibleai/agent-hooks@61952932e52d5dab091a64677f19272daae619f8 -
Branch / Tag:
refs/tags/v0.1.0-alpha.5 - Owner: https://github.com/responsibleai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@61952932e52d5dab091a64677f19272daae619f8 -
Trigger Event:
push
-
Statement type: