Skip to main content

The Active Reliability Layer for AI Agents

Project description

Steer Labs Logo

Steer

steer-labs.com

The Active Reliability Layer for AI Agents.

Intercept hallucinations and protocol drift in runtime.
Enforce deterministic truth on probabilistic model outputs.

PyPI License Twitter


Steer Mission Control

Mission Control: Enforcing deterministic truth on probabilistic model outputs.


Why Steer?

I built Steer because probability cannot fix probability. It provides deterministic verification in runtime and automates DPO data collection.

When a Judge blocks an output and I provide a fix, Steer captures a Rejected/Chosen contrastive pair. I use these production failures to generate the datasets required to refactor a prompt monolith into model weights. This moves reliability from the context window to the model itself.

The Problem: The Agent Lobotomy

Most developers are forced to cripple their agents in production (stripping autonomy and hardcoding paths) because they cannot verify probabilistic output. When an agent fails, simply logging the error is insufficient. You are usually stuck in a prompt-deploy death loop:

  1. Grep production logs for specific input/output pairs.
  2. Manually adjust prompts and hope for no regressions.
  3. Redeploy the entire application for a single instruction update.

The Solution: Reality Locks

Steer wraps agent functions with deterministic Reality Locks. When a failure is detected (JSON syntax error, PII leak, or logic violation), Steer blocks the output and triggers a local "Teachable Moment" UI. You provide a correction, and Steer injects that rule into the agent context at runtime via sidecar dependency injection.

Operational Resilience

  • Low-Latency Sidecar: Verification adds <5ms overhead by running in-process.
  • Fail-Safe Design: Configurable behavior for internal library errors to prioritize uptime.
  • Zero Data Exfiltration: Local-first architecture. Traces and prompts never leave your network.
  • Audit-Ready Logging: Deterministic logs provide a clear trail for compliance audits.

Installation

pip install steer-sdk

Quickstart

Ensure you run all commands from the same directory to keep the local database synced.

steer init   # Generates interactive demo agents
steer ui     # Launches Mission Control at http://localhost:8000
  1. Fail: Run python 01_structure_guard.py. Output shows [-] Status: Blocked.
  2. Teach: Go to the UI. Click the incident, select Teach, and save the rule.
  3. Fix: Run the script again. Output shows [+] Status: Passed.

Reality Locks in Action

The Steer workflow follows a simple loop: Catch -> Teach -> Fix.

1. Structure Guard (JSON)

Problem: Agent wraps JSON in Markdown backticks, breaking your parser. Structure Guard Demo

2. Safety Guard (PII)

Problem: Agent accidentally leaks customer emails or internal keys despite system instructions. Safety Guard Demo

3. Logic Guard (Ambiguity)

Problem: Agent guesses an ambiguous city (e.g., Springfield, IL) instead of asking for clarification. Logic Guard Demo

4. Slop Filter (Brand Voice)

Problem: Agent uses sycophantic "AI-voice" (emojis, em-dashes, apologies) that pollutes data protocols. The Tech: Measures Shannon Entropy of the response. If the signal is too smooth (low entropy), Steer identifies it as an aesthetic lobotomy and blocks the output. Slop Filter Demo

Cookbook

Explore the cookbook/ directory for enterprise-grade implementations.

  • RAG Reliability: Enforcing strict schemas and grounding citations.
  • SQL Security: Enforcing read-only protocols and preventing destructive injections.

Integration: Sidecar Dependency Injection

Add steer_rules to your function arguments. Steer populates this automatically at runtime.

from steer import capture
from steer.Judges import JsonJudge, SlopJudge

locks = [JsonJudge(), SlopJudge(entropy_threshold=3.5)]

@capture(Judges=locks)
def finance_agent(query, steer_rules=""):
    # Rules are injected automatically. 
    # Update agent behavior via local UI without a code redeploy.
    system = f"You are a read-only SQL analyst.\n{steer_rules}"
    return model.generate(system, query)

Data Engine: Synthetic Data for DPO

Steer transforms runtime failures into a training asset. By capturing the delta between a Blocked Response (Rejected) and a Taught Response (Chosen), Steer generates contrastive pairs for Direct Preference Optimization (DPO).

Export Training Data

# Export successful runs for SFT
steer export --format openai

# Export contrastive pairs (Rejected vs Chosen) for DPO
steer export --format dpo

Production-Ready Checklist

  • Pydantic v2 Compatible: Built on high-performance serialization.
  • Thread-Safe: Tested for high-concurrency environments.
  • Zero Dependencies: Minimal footprint to reduce supply-chain risk.
  • Local-First: No external API dependencies for core verification logic.

What is the "Confident Idiot" Problem?

The Confident Idiot is a failure mode where an LLM generates a factually incorrect or structurally broken response with high probability (confidence). Because LLMs fail silently and plausibly, traditional observability is insufficient. Steer provides the verification layer to catch these failures before they hit your users.

Read the viral discussion on Hacker News.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steer_sdk-0.3.9.tar.gz (460.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steer_sdk-0.3.9-py3-none-any.whl (477.8 kB view details)

Uploaded Python 3

File details

Details for the file steer_sdk-0.3.9.tar.gz.

File metadata

  • Download URL: steer_sdk-0.3.9.tar.gz
  • Upload date:
  • Size: 460.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.9 Darwin/24.6.0

File hashes

Hashes for steer_sdk-0.3.9.tar.gz
Algorithm Hash digest
SHA256 97a2bfaa6950f3dffcf3f93663a9c544e12c5981254b814ff3e6ff1a3be65219
MD5 591beeda4c3e0876e181ac9f3a6483ad
BLAKE2b-256 d15296d2c8307ff2e2c640f4b914c10a80d9e2f9dce7b3b6eaf761348e80ae79

See more details on using hashes here.

File details

Details for the file steer_sdk-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: steer_sdk-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 477.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.9 Darwin/24.6.0

File hashes

Hashes for steer_sdk-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 056fc1997cc0f31488da18608843d18ca13f8d82b5812dfe79eb5b16d7245500
MD5 86df572f4325868263a1384a3df27c94
BLAKE2b-256 155070452b8171b738804854e9ef8e9db8da09c07a950222bbe5f25bbb91a658

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page