agentmesh-openai-agents-trust
Trust & governance layer for the OpenAI Agents SDK. Adds policy enforcement, trust-gated handoffs, and tamper-evident audit trails using native SDK guardrails and hooks.
Built by AgentMesh — the open-source trust layer for multi-agent systems. Similar integrations merged into Dify (65K ⭐), LlamaIndex (47K ⭐), and Microsoft Agent-Lightning (15K ⭐).
Install
pip install agentmesh-openai-agents-trust
Quick Start
from agents import Agent, Runner
from openai_agents_trust import (
trust_input_guardrail,
policy_input_guardrail,
GovernanceHooks,
TrustGuardrailConfig,
PolicyGuardrailConfig,
TrustScorer,
GovernancePolicy,
AuditLog,
)
# Shared governance state
scorer = TrustScorer()
audit = AuditLog()
policy = GovernancePolicy(
name="production",
max_tool_calls=20,
blocked_patterns=[r"DROP TABLE", r"rm -rf", r"eval\("],
min_trust_score=0.7,
)
# Create guardrails
trust_config = TrustGuardrailConfig(scorer=scorer, min_score=0.7, audit_log=audit)
policy_config = PolicyGuardrailConfig(policy=policy, audit_log=audit)
# Attach to agents
agent = Agent(
name="researcher",
instructions="You are a research assistant.",
input_guardrails=[
trust_input_guardrail(trust_config),
policy_input_guardrail(policy_config),
],
)
# Run with governance hooks
result = await Runner.run(
agent,
input="Analyze this data",
run_config=RunConfig(hooks=GovernanceHooks(policy=policy, scorer=scorer, audit_log=audit)),
)
# Verify audit integrity
print(f"Audit entries: {len(audit)}")
print(f"Chain valid: {audit.verify_chain()}")
Trust-Gated Handoffs
from openai_agents_trust import trust_gated_handoff
billing_agent = Agent(name="billing", instructions="Handle billing.")
support_agent = Agent(name="support", instructions="Handle support.")
triage = Agent(
name="triage",
handoffs=[
trust_gated_handoff(billing_agent, scorer=scorer, min_score=0.8),
trust_gated_handoff(support_agent, scorer=scorer, min_score=0.6),
],
)
Features
| Feature | SDK Hook | Description |
|---|---|---|
| Trust Guardrail | InputGuardrail |
Blocks agents below trust threshold |
| Policy Guardrail | InputGuardrail |
Enforces blocked patterns, tool limits |
| Content Guardrail | OutputGuardrail |
Validates output against policies |
| Governance Hooks | RunHooksBase |
Tracks tools, audits handoffs, scores trust |
| Trust-Gated Handoff | is_enabled |
Disables handoffs to untrusted agents |
| hash-chain Audit | — | Tamper-evident chain of all decisions |
License
MIT
Metadata
Release files for agentmesh_openai_agents_trust 3.6.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 | Actions |
|---|---|---|---|---|
| agentmesh_openai_agents_trust-3.6.0.tar.gz | 11.7 kB | Without provenance | Details for agentmesh_openai_agents_trust-3.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentmesh_openai_agents_trust-3.6.0-py3-none-any.whl | Python 3 | none | any | Details for agentmesh_openai_agents_trust-3.6.0-py3-none-any.whl |
Total release size: 24.5 kB
Release files / agentmesh_openai_agents_trust-3.6.0.tar.gz
| Download URL | agentmesh_openai_agents_trust-3.6.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9c26d2f95e5781067d24b14b0ac038b98bf80844106c91bd5d57b86d78d9354
|
|
BLAKE2b-256 checksum How to use checksums |
20760d43a9d624cfbada44e3c74c4b851761be4b076bd143f2ca0722c96e7999
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / agentmesh_openai_agents_trust-3.6.0-py3-none-any.whl
| Download URL | agentmesh_openai_agents_trust-3.6.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd175c924827ebd1e462c0c02d325b8ab8445b89b862165c35a5aef63ad454a0
|
|
BLAKE2b-256 checksum How to use checksums |
284dc97201de5d4d92394feeaa759e5c46e4271e6f7e613a4e7bdd0562d09642
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Security for agentmesh_openai_agents_trust 3.6.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.