managed-agents
Nomotic governance for AI agents. Works with any framework.
Govern every tool call before it reaches execution. DENY verdicts block the action. ESCALATE routes to human review. Every evaluation is recorded in your Nomotic audit trail.
Install
pip install managed-agents
Quick Start
from managed_agents import NomoticHarness, GovernanceDenied
harness = NomoticHarness(
api_key="nm_live_...", # from amp.nomotic.ai/settings
agent_id="nmc-...", # from amp.nomotic.ai/identity
platform="langchain", # tags evaluations in your audit trail
)
async def execute_tool(tool_name: str, tool_input: dict) -> str:
await harness.govern(tool_name, tool_input)
return await your_runtime.execute(tool_name, tool_input)
try:
await execute_tool("write_file", {"path": "/etc/passwd", "content": "..."})
except GovernanceDenied as e:
print(f"Blocked: {e}")
With Prescreening
Block destructive patterns before they reach the governance API:
from managed_agents import NomoticHarness, StandardPrescreener
harness = NomoticHarness(
api_key="nm_live_...",
agent_id="nmc-...",
prescreener=StandardPrescreener(
block_destructive_shell=True, # rm -rf, DROP TABLE, mkfs, fork bombs
block_bulk_operations=True, # >10 emails, >20 files, >5 calendar items
escalate_credential_access=True, # .ssh/, .env, /etc/passwd
),
)
With Policy Presets
from managed_agents import NomoticHarness, ToolPolicy
harness = NomoticHarness(
api_key="nm_live_...",
agent_id="nmc-...",
policy=ToolPolicy.SHELL, # trust_threshold=0.85, veto: scope+ethics
# policy=ToolPolicy.FILESYSTEM # trust_threshold=0.75, veto: reversibility
# policy=ToolPolicy.EMAIL # trust_threshold=0.70, veto: data_sensitivity
)
Sync Usage
result = harness.govern_sync("bash", {"command": "ls -la"})
Without an API Key
No api_key → pass-through mode. Prescreener still blocks dangerous patterns. Verdicts logged locally to ~/.nomotic/managed-agents.log.
After 10 evaluations, a nudge suggests registering at amp.nomotic.ai for full governance, audit trail, trust scores, and fleet management.
harness = NomoticHarness(agent_id="local-agent") # no api_key
Framework Support
platform="claude" # Claude Managed Agents
platform="langchain" # LangChain / LangGraph
platform="crewai" # CrewAI
platform="autogen" # AutoGen
platform="openai" # OpenAI SDK / Assistants API
platform="custom" # Any other framework
Session Correlation
from managed_agents import NomoticHarness, GovernedSession
harness = NomoticHarness(api_key="...", agent_id="...")
session = GovernedSession(session_id="sess_abc123", harness=harness)
verdict = await session.govern_and_record("send_email", {"to": "user@example.com"})
print(session.governance_summary())
Configuration
| Parameter | Default | Description |
|---|---|---|
| api_key | None | Nomotic API key. None = pass-through mode |
| agent_id | required | Nomotic agent ID (nmc-...) |
| platform | "custom" | Framework tag for audit trail |
| fail_open | True | Allow on governance service error |
| block_on_escalate | False | Raise GovernanceEscalated on ESCALATE |
| timeout | 3.0 | HTTP timeout in seconds |
| prescreener | None | Pre-evaluation deterministic checks |
| policy | None | Governance policy preset |
| tool_name_map | None | Custom tool name → action verb overrides |
| circuit_breaker | None | CircuitBreaker for API resilience |
| local_log | True | Log verdicts to ~/.nomotic/managed-agents.log |
| suppress_nudge | False | Suppress amp.nomotic.ai registration nudge |
| on_verdict | None | Callback for every verdict |
| on_escalate | None | Callback for ESCALATE verdicts |
| on_deny | None | Callback for DENY verdicts |
| session_id | None | Session ID for multi-turn correlation |
| org_context | {} | Additional context injected into evaluations |
Links
Metadata
Release files for managed-agents 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| managed_agents-0.2.0.tar.gz | 20.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| managed_agents-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.4 kB
Release files / managed_agents-0.2.0.tar.gz
| Download URL | managed_agents-0.2.0.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c51cca0fcbec15d7163e2041a37fb9bc41a233b91f248ab2f2cacb1bc5d10daa
|
|
BLAKE2b-256 checksum How to use checksums |
87ae064fe4aaf8922a78b9f7d052f74033b87ca5bde982d30f35502f131f027e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / managed_agents-0.2.0-py3-none-any.whl
| Download URL | managed_agents-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d911d5fcf146343b42b8fcc165b7e3ff228041286aaf5420642fa93f82e134d0
|
|
BLAKE2b-256 checksum How to use checksums |
c2eab69133bc99bc145b68ecf4ee9f37c3d4a6ba8cdcde0f754e9b1c4035c37d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for managed-agents 0.2.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.