ARGUS — ArgusLabs

Configuration

Configure ARGUS via YAML files and environment variables.

Constructor Parameters

Everything is optional. Pass to the ArgusWatcher constructor to customize behavior per run.

Core
graphStateGraph

LangGraph graph to monitor. If passed, watch() is called automatically.

Default: None

max_field_sizeint

Max characters per field before truncation in stored outputs.

Default: 50_000

strictbool

Enable extra checks: nested error keys, rate-limit responses, empty lists, type mismatches. Recommended for CI/staging.

Default: False

investigatebool | "always"

LLM root-cause investigation. True = on failure only, "always" = every node, False = off.

Default: True

Security
redact_keysset[str]

Field names to redact from stored outputs (e.g. {"password", "api_key"}).

Default: None

validatorsdict

Per-node semantic validators. Use "*" as key to run on every node. Each validator is a (bool, str) callable.

Default: None

Latency
node_timeout_msfloat | None

Flag nodes that take ≥95% of this value as timeout-adjacent (likely truncated output). Pass via ArgusConfig.

Default: None

min_expected_msfloat | None

Flag LLM nodes completing faster than this as suspiciously fast (likely cached/stale). Pass via ArgusConfig.

Default: None

Replay & Evaluation
persist_statebool

Save run records to .argus/runs/. Set False for ephemeral monitoring.

Default: True

record_httpbool

Record all external HTTP/API calls for deterministic replay.

Default: True

semantic_judgebool

LLM-powered quality judge on every node output. Requires OPENAI_API_KEY.

Default: False

judge_modelstr

Model for the semantic judge and investigation.

Default: "gpt-4o"

Full Example

python
watcher = ArgusWatcher(
    graph,
    semantic_judge=True,
    judge_model="gpt-4o-mini",
    strict=True,
    record_http=True,
    redact_keys={"api_key", "token"},
    validators={
        "summarize": lambda o: (len(o.get("summary", "")) > 10, "Summary too short"),
    },
)

Environment Variables

Configuration can also be set via environment variables with the ARGUS_ prefix. Environment variables override config file values.

Core
ARGUS_STRICTbool

Halt execution when a detection fires. Useful in CI/CD to fail builds on quality regressions.

Default: false

ARGUS_INVESTIGATEbool | "always"

Run forensic root cause analysis. Set to "always" to analyze even when no detections fire.

Default: true

ARGUS_MAX_FIELD_SIZEint

Maximum character length for captured state fields.

Default: 50000

Semantic
ARGUS_SEMANTIC_JUDGEbool

Enable LLM-as-judge for semantic detection. Requires OPENAI_API_KEY.

Default: false

ARGUS_JUDGE_MODELstr

Model to use for LLM-as-judge evaluation.

Default: "gpt-4o"

Precedence

Configuration values are resolved in this order (highest priority first):

  1. Constructor arguments — values passed directly to ArgusWatcher()
  2. Environment variablesARGUS_* vars
  3. Config fileargus.yaml in project root
  4. Defaults — built-in sensible defaults

Tip

Use constructor arguments for per-run overrides, environment variables for per-environment settings (dev vs prod), and the config file for project-wide defaults.

Validators

Validators catch semantic failures — when the structure is fine but the value is wrong. Each validator is a callable that returns (bool, str).

python
watcher = ArgusWatcher(graph, validators={
    "classify": lambda o: (o.get("label") in ["yes", "no"], "unexpected label"),
    "*":        lambda o: ("error" not in o, "error key present"),
})

"*" runs on every node.

Strict Mode

Strict mode enables additional detection patterns beyond the defaults: nested error keys, rate limit responses, empty required lists, and list[int] vs list[str] type mismatches.

python
# Recommended for CI/staging
watcher = ArgusWatcher(graph, strict=True)

Security

Always add sensitive field names to redact_keys. ARGUS captures full state at every step — without redaction, API keys and secrets will appear in your stored runs.