Skip to main content

maigp-strands

AIGP governance for the Strands Agents SDK.

Part of MAIGP — the Mediated AI Governance Protocol: a runtime consent / scope / evidence layer for AI systems. Every governed call is CHECKed before it runs (policy, scope, jurisdiction, circuit-breaker) and RECORDed + TRACEd as tamper-evident evidence after.

What it governs

Every model call and every tool call of a Strands agent, through a Strands HookProvider (AigpHookProvider, requires strands-agents>=1.61.1,<2).

Governance model

Strands event AIGP action
BeforeModelCallEvent CHECK (client.check); not ALLOW → event.cancel (the model is not invoked)
AfterModelCallEvent RECORD (tokens, latency, status) for a call that ran
BeforeToolCallEvent TOOL_REQUEST (client.tool_request, SHA-256 of the input); not ALLOW → event.cancel_tool (the tool body never runs; the model gets an error tool result with the reason)
AfterToolCallEvent RECORD (use_case="tool:<name>", output_ref = SHA-256 of the tool result) for a call that ran

Fail closed: only ALLOW / ALLOW_WITH_CONSTRAINTS lets a call run. DENY, RATE_LIMITED, UNCHECKED, a missing decision, an unreachable authority, any error in the CHECK path, or a CHECK slower than check_timeout (default 10 s) cancels the call, in ENFORCE and REPORT mode alike. The provider refuses to register on a disabled client (empty gov_url) or on a Strands whose events cannot cancel. Its before-callbacks run after all other hooks, so the CHECK covers the call that really runs.

Install

pip install maigp-strands

Pulls in maigp-agent-core (shared lifecycle), maigp-client and strands-agents.

Quick start

from strands import Agent
from aigp_strands import AigpGovernance

gov = AigpGovernance(gov_url="https://gov.example.com",
                     app_id="my-strands-agent", hmac_secret="secret")

agent = Agent(model=..., tools=[...], hooks=[gov.hook_provider()])

gov.hook_provider(use_case=..., check_timeout=..., tool_version=...) is the same as AigpHookProvider(gov, ...). use_case defaults to the agent's name.

Deprecated: AigpCallbackHandler

AigpCallbackHandler / gov.callback_handler() does not govern: Strands callback handlers receive streamed output only and cannot block a call, and Strands never calls its on_* methods. Before 1.1.0 it was not even callable, so Agent(callback_handler=...) failed on the first event. Since 1.1.0 it fails closed: it warns (DeprecationWarning) when built, and wired as Agent(callback_handler=...) it raises AigpCallbackHandlerNotGoverning on Strands' first event, before the model is called or any tool runs, so an agent wired the old way refuses to run rather than running ungoverned. It will be removed in 2.0. Replace callback_handler=gov.callback_handler() with hooks=[gov.hook_provider()].


License: Proprietary. © Kanjani AI Research & Causum.

Metadata

Release files for maigp-strands 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maigp-strands 1.1.0
File Size Uploaded Provenance Actions
maigp_strands-1.1.0.tar.gz 14.1 kB Without provenance Details for maigp_strands-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maigp-strands 1.1.0
File Interpreter ABI Platform Actions
maigp_strands-1.1.0-py3-none-any.whl Python 3 none any Details for maigp_strands-1.1.0-py3-none-any.whl

Total release size: 23.9 kB

Release files / maigp_strands-1.1.0.tar.gz

Download URL maigp_strands-1.1.0.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bf449058eb8be8f7fc98b5f81cff47dbe0b864b15077b68146967280c07642dc
BLAKE2b-256 checksum
How to use checksums
c6b712e29b9f5c1757c725da306717a3d7e26e8319aae19ce503f036f5408623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / maigp_strands-1.1.0-py3-none-any.whl

Download URL maigp_strands-1.1.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc393c9ce27863e5f4425e40f6e0d3881a867e4a319542325a293a3f27fa7ed5
BLAKE2b-256 checksum
How to use checksums
ee339cf4128488821ae5ccdc18559c76e79b2be0457758802e7b1fe310393153
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for maigp-strands 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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