Skip to main content
Pre-release

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

agent_hooks_sdk-0.1.0a5.tar.gz (130.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

agent_hooks_sdk-0.1.0a5-cp310-abi3-win_amd64.whl (479.9 kB view details)

Uploaded CPython 3.10+Windows x86-64

agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl (649.0 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl (626.2 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl (570.5 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl (598.9 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

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

Hashes for agent_hooks_sdk-0.1.0a5.tar.gz
Algorithm Hash digest
SHA256 4ae452b0a1d51540a1b74b0005b0a51f75fd4b80e9aca1a7403dece4dd6f9e46
MD5 d6d6fba6c832385e44750b7ea9dd2851
BLAKE2b-256 33f4191de0300a73b9a78f2914e0e497c96e6ac38db457e20f74fdd6251792c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_hooks_sdk-0.1.0a5.tar.gz:

Publisher: release.yml on responsibleai/agent-hooks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 777a4cd3803710277e77d9c6abb6d1a2c9d6ce8977167fe47fc57b8e4ff8bc75
MD5 51fe9b1e17594d796b722b747b44601f
BLAKE2b-256 6ec2d2bb3772abe3b04fc841bc6c667f49adf9ae037c945cbe0d6a8739d419c4

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a4b53cce9dabf1ee8ffffa4b5f6c6d34d269daa699d468e49fad286f0070d23f
MD5 e89d722ff729f984444f505f32f70ca3
BLAKE2b-256 5b22ab5cf6e7fd26e8157637eea4b72a903d1b98dad11872857f32ead29ddcd0

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a5-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a0946af422eadeb3a192a7a856bc40e2b74435ab540dd3586c3cb7939157c91b
MD5 e4ce90156b1d10bebdc73ceafd135270
BLAKE2b-256 2e6d169997cb8ad39fc295854ed25f21171e800298e73e5a12123d3b008149f7

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb1d714ed6baf884525a153821d909fb23c2fe27e63f61ae254f06ee6ec351d4
MD5 56137d7311f64bb99262ffb523b0f945
BLAKE2b-256 14adfe8885b3f3f203d48dba46034d3c92dfd207a9bc504d4ba1356bf57f9234

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a5-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d63893d94ccfbdc6422dd217663ed88aedec0ffd560ecfa105187fa9bda79063
MD5 b66d1fd4c88da571a5959503fe6eb2b6
BLAKE2b-256 d750a6bea9691ef69be1c9c70420e84f773ee721c7e60dafc76069564ba88cc9

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0a5 This release

6 files

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