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.7.tar.gz (460.2 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.7-py3-none-any.whl (477.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: steer_sdk-0.3.7.tar.gz
  • Upload date:
  • Size: 460.2 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.7.tar.gz
Algorithm Hash digest
SHA256 521ed4658ede4408a62f62ac92d4ce923a8a36665f3d39774d996308cc2cc77f
MD5 9de54007907b854d451427d604bfdc4b
BLAKE2b-256 b0dbe41f8792a1720de214dec05d14b56aeda555770a0a09cc87b0507ffdec19

See more details on using hashes here.

File details

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

File metadata

  • Download URL: steer_sdk-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 477.7 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c600d809ae206b4f78969e600f92b866a6d4c20d8c2963ad4cce1122d3ea93fe
MD5 d865b8cc046ac1fc34cd547fa9627804
BLAKE2b-256 3668be6c771547e4ef642b9bbe1143b8ea290fbefdfb13411225b21ed8325aa0

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