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.4.2.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.4.2-py3-none-any.whl (477.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: steer_sdk-0.4.2.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.4.2.tar.gz
Algorithm Hash digest
SHA256 ebb07ad1367e721089e89bbc60bb8866943684541b01557acb2d3d4d53577668
MD5 e89013f0bc5664145df59cda74257769
BLAKE2b-256 44e1c1b95c3ebaea9057e81d9b60a722a4dd0700d4fb4b592a66674a3673ceaa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: steer_sdk-0.4.2-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.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 63d297c839a6cf4f1bbda2c25fe216288a6a81010db2ca4a03e908c862299450
MD5 b7946b5c7ee3643ba9b1ef99d829af91
BLAKE2b-256 6affdafd4c6525d5497eb00c47bc55db467413fe0b26530138ab2b07b1565866

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