System of Oversight and Monitoring for Agents
SOMA is a closed-loop behavioral guidance system. It watches every action an AI agent takes, computes behavioral pressure from multiple signals, and injects corrective feedback before problems escalate. Open-source, MIT licensed.
Capabilities
Real-Time Behavioral Monitoring
6 behavioral signals per action — uncertainty, drift, error rate, goal coherence, cost, and token usage. Watches everything, catches problems early.
Predictive Escalation
Warns ~5 actions before problems escalate. Trend extrapolation and pattern detection catch error streaks, thrashing, and blind writes before they compound.
Corrective Guidance Injection
Injects specific, actionable advice directly into the agent's context. "Read the file before editing" — the agent reads it and changes its behavior.
Epistemic Uncertainty Classification
Distinguishes knowledge gaps from inherent ambiguity via output entropy analysis. Knowledge gaps escalate, inherent ambiguity dampens.
Adaptive Thresholds
Tracks intervention outcomes and tunes thresholds over time. Every agent develops its own behavioral profile — no one-size-fits-all.
Framework Integrations
Native adapters for Claude Code, LangChain, CrewAI, AutoGen, and any Python agent via the SDK. pip install soma-ai and go.
Why It Matters
Your AI agent just edited 5 files without reading any of them. It's retrying the same failing command for the 8th time. It wandered from your auth module into unrelated config files. And you have no idea until it's too late.SOMA sees all of this in real-time — and steers the agent back on track.
The Pipeline
Watch
6 behavioral signals per action — uncertainty, drift, error rate, goal coherence, cost, token usage
Classify
Epistemic vs. aleatoric uncertainty via output entropy — knowledge gaps escalate, inherent ambiguity dampens
Guide
Injects specific advice into agent context — "3 writes without a Read — read the target file first"
Predict
Warns ~5 actions before escalation — trend extrapolation + pattern detection catches problems early
Learn
Tracks intervention outcomes and tunes thresholds over time — no static rules, no false positives
Model
Half-life temporal modeling predicts agent degradation — warns before reliability drops below 50%
4-Mode Guidance
Silent monitoring. Status line shows vitals. Positive feedback when agent behaves well.
Soft suggestions injected into context. Never blocks anything — just nudges.
Insistent warnings with increasing urgency. Still never blocks normal tools.
Blocks ONLY destructive operations: rm -rf, force push, .env writes. Everything else works.
Order vs. chaos — SOMA keeps your agents on the left side
Real Output
$ pip install soma-ai
$ soma setup-claude
✓ SOMA configured for Claude Code
// Real-time guidance injected into agent context:
[do] Read main.py before editing — 3 writes without a Read
[do] STOP retrying, try a different approach — 4 consecutive failures
[do] Start writing code — 7 reads, 0 writes in last 10 actions
[predict] escalation in ~5 actions (error_streak)
[scope] expanded to tests/, config/ — is this intentional?
[quality] grade=D (2 syntax errors, 3/8 bash commands failed)
[✓] good — read before writing, clean edits
// Status line:
SOMA: #42 [implement] ctx=73% focused
Why Not Just Guardrails?
| Approach | Observes | Tells Agent | Guides | Adapts | Multi-Agent |
|---|---|---|---|---|---|
| Guardrails (NeMo, Lakera) | Prompt only | No | Filter | No | No |
| Observability (LangSmith) | Yes | No | No | No | Partial |
| Rate Limiters | No | No | Token cap | No | No |
| SOMA | 6 signals | 7 patterns | 4 modes | Self-learning | Trust graph |
Works Everywhere
Claude Code
Zero-config via soma setup-claude
Python SDK
soma.wrap() for any Anthropic/OpenAI client
LangChain
SomaLangChainCallback adapter
CrewAI
SomaCrewObserver attachment
AutoGen
SomaAutoGenMonitor integration
Any Agent
soma.track() context manager
No Black Boxes
P = 0.7 · mean(wᵢpᵢ) + 0.3 · max(pᵢ)Aggregate pressure — catches gradual and acute failures
z = (x - μ) / max(σ, 0.05) → sigmoid(z)Signal normalization — adapts to each agent's baseline
μₜ = 0.15 · x + 0.85 · μₜ₋₁EMA baseline — half-life of ~4.3 observations
U = 0.30·retry + 0.25·tool + 0.20·fmt + 0.25·entropyComposite uncertainty from 4 behavioral components
D = 1 - cos(v_current, v_baseline)Drift via cosine distance on behavior vectors
P(t) = exp(-ln(2) · t / half_life)Temporal reliability decay
No neural networks. No cloud dependency. No API keys. No telemetry. Just math.
MIT licensed. Forever.
Explore More
Try SOMA
pip install soma-ai — open-source, free, and ready to monitor your agents today.