Trust-based circuit breaking for multi-agent AI systems
Project description
fulcrum-trust
Trust-based circuit breaking for multi-agent AI systems.
What is this?
fulcrum-trust implements a Beta distribution trust model for agent-to-agent relationships. When an agent pair's trust score drops below a configurable threshold, the circuit breaks — terminating the interaction before runaway loops occur.
The math: every interaction updates a Beta(α, β) distribution. Trust score = α / (α + β). Starting at (1.0, 1.0) gives an uninformative prior of 0.5. Scores decay exponentially toward 0.5 over time (stale relationships revert to uncertainty).
Quick Start
from fulcrum_trust import TrustManager, TrustOutcome
# Default: in-memory store, threshold=0.3, 24-hour decay half-life
tm = TrustManager()
# Record interaction outcomes
tm.evaluate("orchestrator", "code-agent", TrustOutcome.SUCCESS)
tm.evaluate("orchestrator", "code-agent", TrustOutcome.SUCCESS)
tm.evaluate("orchestrator", "code-agent", TrustOutcome.FAILURE)
# Check trust
print(tm.get_trust_score("orchestrator", "code-agent")) # 0.6
# Circuit break check — use this in your agent loop
if tm.should_terminate("orchestrator", "code-agent"):
raise RuntimeError("Circuit open — trust degraded below threshold")
Persist across sessions with FileStore:
from fulcrum_trust import TrustManager, TrustOutcome, TrustConfig
from fulcrum_trust.stores import FileStore
tm = TrustManager(
store=FileStore("trust_state.json"),
config=TrustConfig(threshold=0.3, half_life_seconds=3600), # 1-hour decay
)
Send trust events to Fulcrum backend with FulcrumStore:
from fulcrum_trust import FulcrumStore, TrustManager, TrustOutcome
tm = TrustManager(
store=FulcrumStore(
api_key="your-fulcrum-api-key",
base_url="https://api.fulcrumlayer.io", # or local dashboard URL
)
)
tm.evaluate("orchestrator", "code-agent", TrustOutcome.SUCCESS)
FulcrumStore writes locally first and then best-effort ships events to POST /api/trust/events
using X-API-Key. If the network call fails, the agent keeps running and local trust state
remains available.
Install
pip install fulcrum-trust
# Optional numpy fast path for decay math:
pip install "fulcrum-trust[numpy]"
Documentation
- API Reference — all public classes and methods
- Blog post — why agents need circuit breakers
Development
git clone https://github.com/Fulcrum-Governance/fulcrum-trust
cd fulcrum-trust
pip install -e ".[dev]"
pytest # Run tests (requires >=95% coverage)
mypy fulcrum_trust/ # Type check (strict mode)
ruff check . # Lint
ruff format . # Format
Architecture
fulcrum_trust/
├── types.py — TrustOutcome enum, TrustState, TrustConfig dataclasses
├── evaluator.py — TrustEvaluator: Beta(α,β) scoring, pair_id generation
├── decay.py — Exponential decay toward uninformative prior
├── manager.py — TrustManager: orchestrates evaluator + store + decay
└── stores/
├── base.py — TrustStore Protocol (structural subtyping)
├── memory.py — MemoryStore (default, in-process)
├── file.py — FileStore (JSON-backed, cross-session)
└── fulcrum.py — FulcrumStore (local-first + backend event shipping)
License
Apache 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fulcrum_trust-0.1.0.tar.gz.
File metadata
- Download URL: fulcrum_trust-0.1.0.tar.gz
- Upload date:
- Size: 492.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51102243d56a961746dbe8d27daa48b8f320e58a16d7c8b05a131b94ea3db490
|
|
| MD5 |
fcf9d91fe7265e146f49ca321d36d13c
|
|
| BLAKE2b-256 |
72aab8cbd2eadc249ffd00c7d9dc298b00efda520385c9e80fab7c5544601743
|
Provenance
The following attestation bundles were made for fulcrum_trust-0.1.0.tar.gz:
Publisher:
publish.yml on Fulcrum-Governance/fulcrum-trust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fulcrum_trust-0.1.0.tar.gz -
Subject digest:
51102243d56a961746dbe8d27daa48b8f320e58a16d7c8b05a131b94ea3db490 - Sigstore transparency entry: 983749517
- Sigstore integration time:
-
Permalink:
Fulcrum-Governance/fulcrum-trust@ac04509700141af11dc6589865977031a5f23974 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Fulcrum-Governance
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac04509700141af11dc6589865977031a5f23974 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fulcrum_trust-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fulcrum_trust-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9191a541f3b65e86c0b4830e82988e9e5b48ab4379e8222af5684c98f28a3dfa
|
|
| MD5 |
980d40bdc1b551bd6b553ec01529a2f7
|
|
| BLAKE2b-256 |
0781b71bdeebd7b22013ea2d0c435bb488297df45d08db1352f6b46a6abaf374
|
Provenance
The following attestation bundles were made for fulcrum_trust-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Fulcrum-Governance/fulcrum-trust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fulcrum_trust-0.1.0-py3-none-any.whl -
Subject digest:
9191a541f3b65e86c0b4830e82988e9e5b48ab4379e8222af5684c98f28a3dfa - Sigstore transparency entry: 983749521
- Sigstore integration time:
-
Permalink:
Fulcrum-Governance/fulcrum-trust@ac04509700141af11dc6589865977031a5f23974 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Fulcrum-Governance
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac04509700141af11dc6589865977031a5f23974 -
Trigger Event:
push
-
Statement type: