Constructor Parameters
Everything is optional. Pass to the ArgusWatcher constructor to customize behavior per run.
graphStateGraphLangGraph graph to monitor. If passed, watch() is called automatically.
Default: None
max_field_sizeintMax characters per field before truncation in stored outputs.
Default: 50_000
strictboolEnable 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
redact_keysset[str]Field names to redact from stored outputs (e.g. {"password", "api_key"}).
Default: None
validatorsdictPer-node semantic validators. Use "*" as key to run on every node. Each validator is a (bool, str) callable.
Default: None
node_timeout_msfloat | NoneFlag nodes that take ≥95% of this value as timeout-adjacent (likely truncated output). Pass via ArgusConfig.
Default: None
min_expected_msfloat | NoneFlag LLM nodes completing faster than this as suspiciously fast (likely cached/stale). Pass via ArgusConfig.
Default: None
persist_stateboolSave run records to .argus/runs/. Set False for ephemeral monitoring.
Default: True
record_httpboolRecord all external HTTP/API calls for deterministic replay.
Default: True
semantic_judgeboolLLM-powered quality judge on every node output. Requires OPENAI_API_KEY.
Default: False
judge_modelstrModel for the semantic judge and investigation.
Default: "gpt-4o"
Full Example
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.
ARGUS_STRICTboolHalt 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_SIZEintMaximum character length for captured state fields.
Default: 50000
ARGUS_SEMANTIC_JUDGEboolEnable LLM-as-judge for semantic detection. Requires OPENAI_API_KEY.
Default: false
ARGUS_JUDGE_MODELstrModel to use for LLM-as-judge evaluation.
Default: "gpt-4o"
Precedence
Configuration values are resolved in this order (highest priority first):
- Constructor arguments — values passed directly to
ArgusWatcher() - Environment variables —
ARGUS_*vars - Config file —
argus.yamlin project root - Defaults — built-in sensible defaults
Tip
Validators
Validators catch semantic failures — when the structure is fine but the value is wrong. Each validator is a callable that returns (bool, str).
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.
# Recommended for CI/staging
watcher = ArgusWatcher(graph, strict=True)Security
redact_keys. ARGUS captures full state at every step — without redaction, API keys and secrets will appear in your stored runs.