Metadata-Version: 2.4
Name: agent-failsafe
Version: 0.4.0
Summary: FailSafe governance adapter for Microsoft Agent Governance Toolkit
Project-URL: Homepage, https://github.com/MythologIQ/agent-failsafe
Project-URL: Repository, https://github.com/MythologIQ/agent-failsafe
Author-email: Kevin Knapp <kevin@mythologiq.com>
License-Expression: MIT
Keywords: agent,failsafe,governance,security,trust
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: pyyaml>=6.0
Provides-Extra: agent-hypervisor
Requires-Dist: agent-hypervisor>=1.1.0; extra == 'agent-hypervisor'
Provides-Extra: agent-mesh
Requires-Dist: agentmesh-platform>=1.1.0; extra == 'agent-mesh'
Provides-Extra: agent-os
Requires-Dist: agent-os-kernel>=1.1.0; extra == 'agent-os'
Provides-Extra: agent-sre
Requires-Dist: agent-sre>=1.1.0; extra == 'agent-sre'
Provides-Extra: dev
Requires-Dist: agent-hypervisor>=1.1.0; extra == 'dev'
Requires-Dist: agent-os-kernel>=1.1.0; extra == 'dev'
Requires-Dist: agent-sre>=1.1.0; extra == 'dev'
Requires-Dist: agentmesh-platform>=1.1.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: full
Requires-Dist: agent-hypervisor>=1.1.0; extra == 'full'
Requires-Dist: agent-os-kernel>=1.1.0; extra == 'full'
Requires-Dist: agent-sre>=1.1.0; extra == 'full'
Requires-Dist: agentmesh-platform>=1.1.0; extra == 'full'
Description-Content-Type: text/markdown

# agent-failsafe

FailSafe governance adapter for the [Microsoft Agent Governance Toolkit](https://github.com/microsoft/agent-governance-toolkit).

Bridges FailSafe's governance engine (Shadow Genome, risk grading, trust dynamics) into the toolkit's extension points. FailSafe adapts to the toolkit, not the reverse.

**Version**: 0.3.0 | **Python**: >= 3.11 | **License**: MIT

## Installation

```bash
# Core only (types, clients, patterns, trust scoring)
pip install agent-failsafe

# With specific toolkit packages
pip install agent-failsafe[agent-os]          # Interceptor + Integration + Webhook events
pip install agent-failsafe[agent-sre]         # SLI + Signal generation
pip install agent-failsafe[agent-mesh]        # Audit sink
pip install agent-failsafe[agent-hypervisor]  # ExecutionRing + KillSwitch

# Everything
pip install agent-failsafe[full]
```

## Extension Points

| Adapter | Toolkit Extension Point | Module |
|---|---|---|
| `FailSafeInterceptor` | `ToolCallInterceptor` | `interceptor.py` |
| `FailSafeKernel` | `BaseIntegration` + `@register_adapter` | `integration.py` |
| `GovernancePipeline` | Full lifecycle orchestration | `pipeline.py` |
| `FailSafeRingAdapter` | `ExecutionRing` + `KillSwitch` | `ring_adapter.py` |
| `FailSafeTrustValidator` | `ValidatorInterface` (control plane) | `trust_validator.py` |
| `ShadowGenomePolicyProvider` | `PolicyProviderInterface` | `policy_provider.py` |
| `FailSafeComplianceSLI` | `SLI` (agent-sre) | `sli.py` |
| `FailSafeAuditSink` | `AuditSink` | `audit_sink.py` |
| `FailSafeApprovalBackend` | `ApprovalBackend` | `escalation.py` |
| `FailSafeTrustMapper` | DID translation (`did:myth` <> `did:mesh`) | `trust_mapper.py` |
| `decision_to_webhook_event` | `WebhookEvent` translation | `webhook_events.py` |

## Quick Start

```python
from agent_failsafe import LocalFailSafeClient, GovernancePipeline, DecisionRequest

client = LocalFailSafeClient()
pipeline = GovernancePipeline(client=client)

request = DecisionRequest(action="file.write", agent_did="did:myth:scrivener:abc")
result = pipeline.evaluate(request)

if result.allowed:
    print(f"Allowed. Ring: {result.execution_ring}")
else:
    print(f"Denied at {result.stage.value}: {result.halted_reason}")
```

See [docs/ADAPTER_ARCHITECTURE.md](docs/ADAPTER_ARCHITECTURE.md) for full API reference.

## License

MIT
