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, Decision, Verdict

class MyPolicy:
    def intercept(self, ctx: AgentContext) -> Verdict:
        if ctx["interception_point"] == "pre_tool_call" and ctx["tool_call"]["name"] == "rm":
            return Verdict(decision=Decision.DENY, reason="dangerous")
        return Verdict(decision=Decision.ALLOW)

Verdict.warn(...) (allow + recorded warning) and Verdict.escalate(...) (liftable deny for the approval seam, §9) are the constructor shortcuts for the other two §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.0a4.tar.gz (173.7 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.0a4-cp310-abi3-win_amd64.whl (479.9 kB view details)

Uploaded CPython 3.10+Windows x86-64

agent_hooks_sdk-0.1.0a4-cp310-abi3-manylinux_2_34_x86_64.whl (634.2 kB view details)

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

agent_hooks_sdk-0.1.0a4-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.0a4-cp310-abi3-manylinux_2_28_aarch64.whl (626.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

agent_hooks_sdk-0.1.0a4-cp310-abi3-macosx_11_0_arm64.whl (570.7 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

agent_hooks_sdk-0.1.0a4-cp310-abi3-macosx_10_12_x86_64.whl (599.1 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file agent_hooks_sdk-0.1.0a4.tar.gz.

File metadata

  • Download URL: agent_hooks_sdk-0.1.0a4.tar.gz
  • Upload date:
  • Size: 173.7 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.0a4.tar.gz
Algorithm Hash digest
SHA256 e3affd44d7779b8254fd5142f7d41648e48d3d4646acc94b07a28d13c5c07b1d
MD5 303aec5d5667b0ceee7bf02077190a16
BLAKE2b-256 c49b07e9e54941ce60991ce8ba00fe9dc38ea96d885b38a86cd944a409cd7772

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_hooks_sdk-0.1.0a4.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.0a4-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5e1cd64e3ef9c7447cb56a615f79747b7aa42a0065c8a2c5f0b2ae7f0447c908
MD5 01a33878b042ce971e990a5d5191234b
BLAKE2b-256 342f35caaffec73e0e60829a2ec255da1bfc7fe9564876b97eaa4a063327fd93

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_hooks_sdk-0.1.0a4-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.0a4-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a4-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 86f5ff8e0c1201a61b113026c688fc98ea590b10f8bbc5ccfa6ac289fdec037d
MD5 5ff6818d5d31ae34e222e5b7b1e37f59
BLAKE2b-256 d607dc7f4e7a53c208ba35fcf0bd0208cf77a1e84ffd7a42d2a61c6e9faf274b

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_hooks_sdk-0.1.0a4-cp310-abi3-manylinux_2_34_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.0a4-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a4-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ed556c2d020fffe371eda8055950f7b42c22eee16f3c3ef1dcf1f4ba5704320e
MD5 a7b043cc0dd173e06bfa984d6deca1f5
BLAKE2b-256 a893bce858a4e83480373eb55e2923657126e0e736b152f814fcf035b293e3e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_hooks_sdk-0.1.0a4-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.0a4-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a4-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fa51c408f29fa907be33e8a542f1025b2a92ccce0ccad0a362c299b6cb6dfdd4
MD5 2c07889c5108117134d8e21cff4dbe99
BLAKE2b-256 6f4c26c71782f12e691958dcb59d530c5a17e8efe4651af3085c52db578e56f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_hooks_sdk-0.1.0a4-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.0a4-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7299cfd93ed455f0bcbfafb759040500e2920c6547fb6d8829f792307d58a6d4
MD5 21e7cb4a535685f96420d8fb891371d9
BLAKE2b-256 0b822f1d273fc4abd882b8a82c0c65574a0bf56c7181bc1a6be52b2bd58d880b

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_hooks_sdk-0.1.0a4-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.0a4-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for agent_hooks_sdk-0.1.0a4-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 793cf357413546ddc74c62dac10bf62c05a0ffe69009871fd3484105995a13b7
MD5 f7ca789489f1f11a462b7fb81f858df4
BLAKE2b-256 b2f85d27dd5a784c7037cbdd23f8ae7982354440a333e9433b19ea02bf8a0ca3

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_hooks_sdk-0.1.0a4-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.0a4 This release

7 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