Metadata-Version: 2.5
Name: maigp-bedrock-agentcore
Version: 1.1.1
Summary: AIGP governance adapter for AWS Bedrock AgentCore Runtime
Requires-Python: >=3.11
Requires-Dist: bedrock-agentcore
Requires-Dist: maigp-agent-core>=1.0.0
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.20; extra == 'otel'
Description-Content-Type: text/markdown

# maigp-bedrock-agentcore

AIGP governance for the AWS Bedrock AgentCore Runtime.

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

## What it governs

Governs agents running on `BedrockAgentCoreApp` — model, tools, and helper resolution.

## Governance model

This adapter maps the framework's lifecycle onto the AIGP agent-governance loop provided by [`maigp-agent-core`](https://pypi.org/project/maigp-agent-core/):

| Framework event | AIGP action |
|---|---|
| run / invocation start | **CHECK** (`pre_invoke`) — allowed? under what authority? |
| each model reply | token accounting (`on_model_call`) |
| each tool / function call | tool governance (`on_tool_call`) |
| run complete | **RECORD** + **TRACE** (`post_invoke`) |
| failure | `on_error` (recorded, then re-raised) |


## Install

```bash
pip install maigp-bedrock-agentcore
```

Pulls in [`maigp-agent-core`](https://pypi.org/project/maigp-agent-core/) (shared lifecycle) and, transitively, [`maigp-client`](https://pypi.org/project/maigp-client/).

## Quick start

```python
from aigp_agentcore import AgentCoreGovernance, governance_middleware

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

# Register as AgentCore middleware: pre-invoke policy check, helper
# resolution (endpoints + tokens), post-invoke evidence, enforcement.
app.add_middleware(governance_middleware(gov))
```

## Package naming

The distribution is **`maigp-bedrock-agentcore`** (the import module remains `aigp_agentcore`). It was renamed from `maigp-agentcore` because PyPI rejected that name as too similar to the core library `maigp-agent-core`.

## Helper resolution

`HelperResolver` fetches downstream endpoints + tokens from the vault (`VLT_PRJ`) and records traces/evidence to the governance app (`GOV_APP`).

## Links

- Protocol, specs & full adapter catalog: https://github.com/owner-spec/aigp-protocol
- Issues: https://github.com/owner-spec/aigp-protocol/issues

---

License: Proprietary. © Kanjani AI Research & Causum.
