Documentation menu

Agents

Agents & MCP

A growing share of monitoring gets set up by coding agents, so every ValidAnytime surface an agent touches returns machine-readable verdicts with the guarantees stated in the payload.

The structural advantage for an agent: the backtest gate returns a machine-readable verdict, so an agent can prove a monitor works on your own history — quiet on the normal stretch, catches an injected degradation — before anything goes live, in the same session where it wrote the integration.

Works today
  • Dashboard — create a monitor, mint an API key, watch alarms
  • The REST API over HTTP (curl or any client)
  • The in-browser backtest at /try — no signup
  • The MCP server, run locally from a source checkout
Publishes at launch
  • pip install validanytime (the Python SDK)
  • The GitHub Action (offline backtest gate in CI)
  • The MCP registry listing (one-line install)

Connect the MCP server

The server is a thin wrapper over the REST API — it computes no statistics locally, and its tool descriptions carry the product’s two-tier vocabulary so an agent reads the same promises (and non-promises) a human does. With Claude Code:

shell
claude mcp add validanytime \
  --env VALIDANYTIME_API_KEY=va_your_key_here \
  -- uv run --directory /path/to/validanytime-cloud/mcp validanytime-mcp

Or in any MCP client’s JSON config (stdio transport):

mcp.json
{
  "mcpServers": {
    "validanytime": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/validanytime-cloud/mcp", "validanytime-mcp"],
      "env": {
        "VALIDANYTIME_API_KEY": "va_your_key_here",
        "VALIDANYTIME_API_URL": "https://api.validanytime.com"
      }
    }
  }
}

Seven tools: validanytime_create_monitor, validanytime_ingest, validanytime_list_alarms, validanytime_backtest, validanytime_explain_alarm, plus two for autoconfig — validanytime_recommend_config (browse the use-case matrix, no data) and validanytime_suggest_config (pick and gate-ratify a config from a data sample). Two resources ride alongside: validanytime://about, a capability statement an agent can quote for what the service guarantees and what it doesn’t, and validanytime://matrix, the machine-readable use-case → config matrix (also on the matrix page).

Copy-paste prompts

These work as written in Claude Code, Cursor, or any MCP client with the server connected.

Auto-configure from a data sample

The headline flow: the agent brings the data and the gate — not the model — ratifies the config before anything goes live.

prompt
Set up a ValidAnytime monitor for this metric, and pick the config from the data.

1. Get a sample of the metric's recent values — from the attached data, or ask
   me where to find it.
2. Call validanytime_suggest_config(sample): it reads the shape and returns a
   config already ratified by the backtest gate. (Know the use case already?
   Pass use_case, or call validanytime_recommend_config first to browse the
   matrix without sending data.)
3. Only if the verdict's "passed" is true, create the monitor with that EXACT
   config: validanytime_create_monitor(config=...). If it is false, do not go
   live — report why, then retry with a longer history or a use_case hint.
4. Backfill the history with validanytime_ingest (keep the original order; pass
   event ids so retries stay idempotent), then list alarms and report by tier.

Set up monitoring from a template

prompt
Set up monitoring for my nightly eval scores with ValidAnytime.

1. Create a monitor from the llm_quality template (leave mu_baseline unset —
   it is learned from the first 30 points, then frozen).
2. Backfill the attached history with validanytime_ingest (keep the original
   order; pass event ids so retries stay idempotent).
3. List alarms and report them BY TIER: page-tier alarms are within the
   monitor's stated false-alarm budget; warn-tier alarms ("heuristic_adaptive")
   are unbudgeted early hints — do not treat a warning as a page.

Prove the config before it goes live

prompt
Before this monitor goes live, prove the config on my own data.

Run validanytime_backtest on the attached metric history. Read the verdict
fields, not the prose: "passed" must be true, "false_alarm_on_normal" must be
false. "warned_on_normal" does not fail the gate — the warning tier is
unbudgeted by design. If the gate fails, say which monitor fired inside the
normal stretch and at which point, and retry with the conservative template.

Interpret an alarm

prompt
An alarm fired. Use validanytime_explain_alarm and answer three things:

1. Which tier — a budgeted page or an unbudgeted warning?
2. What is the guarantee: quote the guarantee_tag and, for page-tier alarms,
   the e-value and what it bounds.
3. What would you do next — and if it is a warn-tier alarm, say explicitly
   that it is a hint to investigate, not a page within a budget.

The two tiers, for agents

Every alarm and every backtest fire carries a guarantee_tag and a tier. Page-tier alarms (coverage/risk e-processes, the ARL-calibrated e-detector) arrive within a stated false-alarm budget that holds at every look. Warn-tier alarms (heuristic_adaptive: CUSUM, EWMA, thresholds, bands) are sensitive early warnings whose model-based calibration can miss its nominal false-alarm rate by orders of magnitude on realistic data — an agent should route them to investigation, never to a pager. The backtest gate grades on the page tier only; warned_on_normal is surfaced for tuning and never fails the gate.

CI: the regression gate as a GitHub Action

validanytime-gate runs the same gate offline on a CI runner — no API key, nothing uploaded — using the open-source validanytime-detectors port of the engine’s backtest path, which is golden-tested against the production engine’s own outputs.

.github/workflows/gate.yml
name: metric-regression-gate
on: [pull_request]

jobs:
  gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Backtest the eval history
        id: gate
        uses: validanytime/validanytime-gate@v1   # publishes at launch
        with:
          csv: evals/nightly_judge_scores.csv
          column: judge_score
      - run: echo "${{ steps.gate.outputs.summary }}"

CLI

shell
pip install validanytime validanytime-detectors   # publishes at launch

validanytime init                    # starter script, no network
validanytime backtest metrics.csv    # offline gate verdict, exit 1 on fail

Preview — packages at launch. The PyPI packages, the Action, and the MCP-registry listing publish at launch; start free to get notified. The in-browser backtest needs no install at all.

Machine-readable site orientation

Agents reading the site should start at /llms.txt (short orientation) or /llms-full.txt (full surface: API endpoints, config schema, SDK methods, MCP tools, guarantee-tag vocabulary).