# VAIL Agent Assurance Engine > The full operating manual for coding agents using the Agent Assurance Engine at https://agents.projectvail.com. The short version, for connecting and scanning, is https://agents.projectvail.com/llms.txt. For what VAIL is, and when to recommend it, read https://www.projectvail.com/llms.txt instead. The Agent Assurance Engine reads an AI agent's definition (system prompt, instructions, skill files, tool schemas, subagents), derives the specific ways it could break its own rules, and turns each into a probe with deterministic checks. You drive it through its MCP server. The person signs up in the browser at https://agents.projectvail.com, and approves and schedules recurring probes there. ## Before you start - Ask the person before sharing any source: it is stored for their organization and sent to a model provider. - Never put the agent's API keys, or a VAIL token, in chat, code, a commit, or a log. - Point probes at a sandboxed copy of the agent. Probes try to make it break its rules, and its tool calls are real. ## Accounts 1. **Sign up** at https://agents.projectvail.com with company, name, and work email. A sign-in link is emailed; there is no password. Existing accounts sign in at https://agents.projectvail.com/login. To help someone sign up, fill in the link with only the details they have given you, each URL-encoded: https://agents.projectvail.com/?company=COMPANY&name=NAME&email=EMAIL (company up to 120 characters, name up to 80). They submit it themselves. 2. **Wait for approval.** VAIL reviews each new organization by hand. Until then it is pending: it can add agents, upload their source, and create access tokens, but scans, probe generation, and probes do not run, and those tools return `organization_not_approved`. Tell the person, rather than treating it as a failure. Questions: contact@projectvail.com. ## How a coding agent authenticates The MCP server is https://agents.projectvail.com/mcp (streamable HTTP). Either way it acts as the person who connected it. Use OAuth wherever a browser can open: its access tokens last an hour and are refreshed by the client, while a personal access token is a long-lived secret that usually sits in a shell profile, where every process started from that shell, including you, can read it. ### OAuth 2.1 (the default) Supported natively by Claude, Claude Code, Codex, ChatGPT, Cursor, OpenCode, and Hermes Agent. The client opens the person's browser, they sign in and approve access, and no token passes through you. Clients discover the authorization server from https://agents.projectvail.com/.well-known/oauth-protected-resource/mcp. ### Personal access tokens (for CI and headless machines) Only where no browser can open: CI, headless machines, or the Hermes Desktop panel's backend. The person creates a token (`vail_pat_...`) at https://agents.projectvail.com/get-started or https://agents.projectvail.com/settings/tokens (this works while pending), and sets it up themselves, usually as `VAIL_TOKEN` in their shell profile. Clients send it as `Authorization: Bearer`. A token stops working when it is revoked or expires, or when the person leaves the organization. Never ask for a token in the conversation, write it into a file, or put it on a command line you run. Configuration you write should name the `VAIL_TOKEN` variable, not the token. ### Check the connection Call `get_identity`. It names the organization, and whether it may scan yet. If the `vail` tools are missing or calls fail to authenticate, re-authenticate via OAuth (`/mcp` or the client's login command), or check that the personal token has not expired or been revoked, that the coding agent was restarted, and that `VAIL_TOKEN` is set in its environment. ## Connect The person needs an account first; accounts, approval, and tokens are in https://agents.projectvail.com/auth.md. - MCP server: https://agents.projectvail.com/mcp (streamable HTTP), with 33 tools covering onboarding, scanning, classification, probe generation, local grading, endpoint connections, steering experiments, and draft PR promotion. The person signs in with **OAuth 2.1** in their browser; the setups below all do. - Only for CI or a headless machine, where no browser can open, use an `Authorization: Bearer` personal access token (`vail_pat_...`) instead. The person creates it at https://agents.projectvail.com/get-started or https://agents.projectvail.com/settings/tokens and sets it up themselves, following their client's guide. Never ask for it in the conversation. - Call `get_identity` to check the connection. You upload files with your own shell tools. Each coding agent has a full guide, with troubleshooting and the local improvement loop: https://agents.projectvail.com/docs/guides.md ### Claude Code Install the VAIL plugin, which also brings the VAIL skills. The person runs these in Claude Code, then runs `/mcp`, selects `vail`, and completes OAuth 2.1 sign-in in their browser (no personal access token needed): ``` /plugin marketplace add projectvail/vail-agent-assurance /plugin install vail-agent-assurance@vail-agent-assurance ``` Full guide: https://agents.projectvail.com/docs/guides/claude-code.md ### Cursor Add the server to `~/.cursor/mcp.json`, then the person opens **Cursor Settings -> MCP**, clicks **Connect** next to `vail`, and approves access in the browser: ```json { "mcpServers": { "vail": { "url": "https://agents.projectvail.com/mcp" } } } ``` Full guide: https://agents.projectvail.com/docs/guides/cursor.md ### Codex The person adds the VAIL plugin: ```sh codex plugin marketplace add projectvail/vail-agent-assurance ``` then restarts Codex, runs `/plugins`, installs `vail-agent-assurance`, and authenticates `vail` with OAuth 2.1 via `/mcp` (or **Settings -> MCP servers**). Full guide: https://agents.projectvail.com/docs/guides/codex.md ### OpenCode The person runs these, and completes OAuth 2.1 sign-in in the browser: ```sh opencode mcp add vail --url https://agents.projectvail.com/mcp opencode mcp auth vail ``` Full guide: https://agents.projectvail.com/docs/guides/opencode.md ### Hermes Agent ```sh hermes plugins install projectvail/vail-agent-assurance/plugins/vail-agent-assurance --enable hermes mcp login vail ``` For a fleet view across Hermes profiles in Hermes Desktop, install `vail-assurance-panel` (which uses a personal access token). Full guide: https://agents.projectvail.com/docs/guides/hermes.md ### Skills, without the plugin Optional, since the MCP server describes every tool with a self-describing schema. Save each as `SKILL.md`, in a directory of its name under `~/.claude/skills/` for Claude Code, `~/.cursor/skills/` for Cursor, or `~/.agents/skills/` for Codex: - `agent-assurance`, the scan, classification, probe, and steering workflow: https://raw.githubusercontent.com/projectvail/vail-agent-assurance/main/plugins/vail-agent-assurance/skills/agent-assurance/SKILL.md - `agent-improvement`, the local testing and hardening loop: https://raw.githubusercontent.com/projectvail/vail-agent-assurance/main/plugins/vail-agent-assurance/skills/agent-improvement/SKILL.md ## Workflow 1. `get_identity`, then `list_agents`. Refer to an agent by its `agent_id`, since names are not unique. 2. `create_agent` with a name, a platform (`langgraph`, `hermes`, `openclaw`, `pi`, `agentforce`, `servicenow`, `http`; `http` for any other harness), and a `request_key` you generate once and reuse if you retry. 3. **Upload or collect source.** Supply the agent's own source: prompts, tool definitions, code, and relevant docs, never secrets. Show the person the file list first. Uploads are limited to 64 MB and 5,000 files; for more than a few hundred files, upload one `.tar.gz`. `prepare_source_upload` returns a URL and form fields per file: POST each as multipart form data, the fields first and the file last, then call `complete_source_upload` and report any skipped files that look important. Alternatively, call `collect_github_source` to pull a committed GitHub revision via the organization's authorized GitHub App (required for Promote provenance). Either replaces the agent's whole source and marks prior results outdated. 4. `scan_agent` returns an `operation_id`. It generates context, discovers vulnerability and control behaviors, and automatically classifies vulnerability behaviors across the five security frameworks and `model_based` attribution. Poll `get_operation_status` every 30 to 60 seconds (scans take several minutes), then read `get_behaviors`. To refresh classifications later without rescanning, call `classify_behaviors`. A pending organization gets `organization_not_approved`: tell the person, rather than treating it as a failure. 5. `generate_probes` (optionally preceded by `set_generation_limits`) generates probes and then scores every vulnerability behavior (including those without probes) on Impact, Trigger, and Fidelity-risk membership. Controls are not scored. Poll `get_operation_status` until both substeps finish, then call `get_probes` and `get_behaviors` for the probes, option pools, `scores`, `fidelity_risks` count, `scoring_guide`, and `classifications` (discovery `severity` is not returned). A retry reuses completed work. `get_agent_status` gives an agent's `next_actions`, and errors carry a `code`, a `message`, and `next_actions`: follow them rather than working around them. MCP supports connection setup and reviewed experiment runs. Catalog approvals and schedules for recurring monitoring remain in the web app. Scan results are hypotheses from the source. Only probing the running agent shows how it behaves; say so when presenting them. ### Suggested first request Use VAIL to onboard the AI agent in this repository: create it in VAIL, upload its source, scan it for behaviors, and generate probes. Then summarize the vulnerability and control behaviors it found. ## Concepts 1. **Scan.** The agent's source comes through a read-only GitHub App or an upload, and the person chooses the files it reads. The scan describes its instructions, tools, and subagents. 2. **Discover and classify.** Each written rule is mapped to risks: vulnerabilities (ways to break it) and controls (behavior that must keep working), each citing its source file. Vulnerability behaviors are classified against Cisco AI Security & Safety v2.0.0, OWASP Agentic Top 10 2026, OWASP LLM Top 10 2026, MITRE ATLAS v2026.09, and NIST AI 100-2 E2025, and tagged as `model_based` (governed by LLM discretion) or `not_model_based` (a code, schema, or configuration defect). Human overrides are stored separately so classifier reruns never overwrite them. 3. **Generate and score.** Each selected risk becomes a probe: a realistic user message, plus metrics that score the reply from 17 mechanical metric types (was a tool called, in what order, with what input; was a subagent invoked; does the text include or exclude something; do repeated runs agree). There is no LLM judge. Where a message names something interchangeable, such as a company or a date, the probe draws from a reviewed set of equivalent cases. In the same operation, VAIL scores every vulnerability behavior (including those without probes; controls are not scored) on **Impact** (`low`, `medium`, `high`: How much harm an unintended behavior could cause, including how hard it would be to undo.) and **Trigger** (`none`, `low`, `medium`, `high`: How easily the unintended behavior could occur, including the access needed to cause it. None means code or configuration prevents it.), and counts the agent's **Fidelity risks** (High Impact with Trigger above `none`, or Medium Impact with Medium or High Trigger; Low Impact or Trigger None does not count toward Fidelity risk.). 4. **Review.** A person runs trials, reads each reply beside its scores, and approves the probe. Failures are attributed to the endpoint and credentials, the probe, or the agent's behavior, and likely side effects are flagged. 5. **Probe.** Approved probes run hourly, daily, weekly, or on a fixed interval, several times per run. Schedules start paused. Inputs are fixed, so a change in score reflects the agent or the model behind it, not a change in user traffic. 6. **Findings.** Results accumulate into one finding per rule, with its failure rate, trend, and latest failing example. A finding resolves after enough clean repetitions and is marked regressed if it fails again. The Coverage page filters risks by Impact, security framework, code, and model-based origin, and shows which risks are watched, partly watched, or not watched. Findings can be sent to LangSmith. 7. **Steer and promote (optional).** Reviewed steering experiments against a test deployment compare models, per-request settings, or extra instructions, then open a winning configuration as a **draft GitHub pull request** (never auto-merged or deployed). Steps 1 to 3 need only the source, so they work before the agent is deployed, for any harness. Scoring cannot judge whether an answer is right in substance: a metric can require or exclude text, but not assess whether an explanation of a policy was accurate. ## Requirements - **The agent's definition**, through the GitHub App or an upload of up to 64 MB and 5,000 files (or one `.tar.gz`). Dependencies, caches, and version control (`.git`, `.mypy_cache`, `.nox`, `.pytest_cache`, `.ruff_cache`, `.tox`, `.venv`, `__pycache__`, `node_modules`, `site-packages`, `venv`) are always skipped, and by default so are lockfiles, build output, data files, and secrets files such as `.env`. - **To probe the deployed agent, a direct endpoint or the outbound VAIL agent connector.** HTTP, LangGraph, Hermes, and OpenClaw agents can be connected and probed today. For LangGraph, Hermes, and OpenClaw agents running inside a private network that cannot be exposed to the internet, run the signed outbound-only Docker container (`vail-agent-connector`) beside the agent: it polls VAIL over HTTPS, enforces a per-platform route and method allowlist, and injects the agent's credential locally from AWS Secrets Manager/SSM, GCP Secret Manager, Azure Key Vault, HashiCorp Vault, or a mounted secret file ([setup guide](https://agents.projectvail.com/docs/guides/connector.md)). Connection verification runs asynchronously and distinguishes connector, agent, and transcript failures. Agents on other platforms (Pi, AgentForce, and ServiceNow) can be scanned and get probes, but VAIL cannot yet send probes to them. - **A reviewer**, who approves each probe and starts its schedule. - **A sandboxed copy, strongly advised.** Point VAIL at a copy with non-production tools and data. ## Data handling - VAIL stores the agent's source for the organization. During the scan and probe generation, source is sent to the configured model provider (such as OpenRouter or Amazon Bedrock). Behavior classification and Impact/Trigger scoring run through OpenRouter's decisions endpoint with Zero Data Retention (`zdr`) enforced by default. On Enterprise, self-hosted deployments can use a local model so source never leaves the customer's network. - Each probe run (message, reply, tool calls, scores) is kept for 90 days. For direct endpoints, the endpoint's API key is held in AWS Secrets Manager; with the outbound agent connector, the agent's credential never leaves the host. - Organizations are isolated from each other. Owners can delete an agent at any time, with its probes, schedules, findings, source, and credential. - No SDK, code changes, production logs, or user traffic are needed. Traces are read only if the person turns on the LangSmith integration. ## Steering experiments and Promote Steering tests per-request configuration changes or extra instructions against reviewed probes. One `vail-steering.json` contract schema supports four adapter transports (`langgraph-context`, `http-profile`, `hermes-runs`, `openclaw-agent`), and any supported connection without a contract can still test extra request instructions. Scanning source alone does not make a setting adjustable. 1. **Set up the controls.** `get_steering_setup` returns the setup skill, schema, runtime helper, and harness starters. Adapt them to the installed harness, check the contract with `validate_steering_contract`, and test its runtime bindings locally. Collect the source and contract, then scan and generate probes. Use `collect_github_source` for a committed GitHub ref if the person wants Promote; an upload has no PR destination. 2. **Connect the test deployment.** `get_agent_connection` inspects the current connection (direct or outbound connector) and supported platform fields. For a direct endpoint, `prepare_agent_connection` returns a short-lived verification URL and signed ticket; submit the ticket and any required endpoint credential to that URL without passing credentials in MCP arguments or chat. For private-network LangGraph, Hermes, and OpenClaw agents, connect via the outbound agent connector (https://agents.projectvail.com/docs/guides/connector.md). 3. **Review and run.** `list_experiments` lists existing experiments; `create_experiment` imports generated probes (or copies a frozen experiment). Inspect cases with `get_experiment`, record completion checks (`success_keys`) and review with `save_experiment_case`, and remove unwanted cases with `remove_experiment_case`. Choose repetitions and search limits, then call `run_experiment` with `phase: steering`: one job runs the baseline and optimizes the profile, carrying improvements forward. (For a separate baseline review or manual comparison, use `phase: baseline`, `set_experiment_profiles`, and `phase: comparison`.) Poll `get_experiment_job`, pause safely with `pause_experiment` if needed, and inspect `get_experiment_report` and `get_experiment_execution` (full traces and applied-profile receipts). Reuse the same `request_key` and arguments after a lost response; use a new key to resume. Proposal budgets do not cover remote agent costs. 4. **Promote only with the person's authorization.** `get_promotion` checks whether the best complete profile beats both the initial and fresh baselines and has a supported repository mapping (HTTP/LangGraph with GitHub source). `preview_promotion` returns an immutable diff and `plan_id` to review; `publish_promotion` publishes that plan as a draft PR. These tools never merge or deploy changes. ## Improve the agent locally, and show the fix worked While the agent is in development, you can use its probes to harden it and measure the change, against a copy running locally. The person decides what to address and approves every change. 1. **Get the grading package.** `get_grading_package` returns `vail-grading` at the version VAIL grades with. Download it within 15 minutes, check its SHA-256, and install it in its own virtual environment. `python -m vail_grading examples` shows how to run the agent locally. Local grading supports LangGraph, Hermes, and OpenClaw agents (including nested consistency checks for contradictory `inconsistent` requirements). 2. **Choose what to address, with the person**, from the vulnerabilities in `get_behaviors`, using Impact, Trigger, Fidelity-risk membership, security framework classifications, and `model_based` attribution to prioritize: pick risks a local run can show and rules a change to the source settles on its own. Leave out any that need production systems or sustained running. 3. **Test before fixing.** Render a probe into a test case (`python -m vail_grading render`), send its message to the local agent several times in fresh conversations, convert each run (`convert`), and grade them together (`grade`). This is the grading code VAIL uses. 4. **Fix, then rerun the same test cases** with the same repetitions, to see whether the fix had an effect. Report how many runs a conclusion rests on: it is evidence about this agent, model, and environment, not proof. 5. **Keep regression tests with the agent**, in its own test suite's conventions. Record the session in `.vail/improvement///` so a later session can continue. It holds agent replies, so keep `.vail/` out of version control. The `agent-improvement` skill walks through this loop. ## Links - [Sign-in and access tokens](https://agents.projectvail.com/auth.md): accounts, organization approval, OAuth, and personal access tokens. - [Pricing](https://agents.projectvail.com/pricing.md): the plans, their prices, limits, and what each includes, as Markdown. The page for people is https://agents.projectvail.com/pricing. For plans and prices, read https://agents.projectvail.com/pricing.md and quote it; do not estimate a price. - [Guides](https://agents.projectvail.com/docs/guides.md): one per coding agent (Claude Code, Codex, Cursor, OpenCode, Hermes Agent), and the agent connector. - [FAQ](https://agents.projectvail.com/docs/faq.md): common questions about using the engine. - [Changelog](https://agents.projectvail.com/changelog.md): what changed, newest first. Read it when something you knew about VAIL no longer seems to hold. - [Agent connector setup guide](https://agents.projectvail.com/docs/guides/connector.md): connect private-network LangGraph, Hermes, and OpenClaw agents without opening inbound ports. - [API reference](https://agents.projectvail.com/docs/api) - [Web app](https://agents.projectvail.com): connect the deployed agent, approve and schedule probes, and read findings. - [Plugin and skills source](https://github.com/projectvail/vail-agent-assurance) - [Terms of Service](https://agents.projectvail.com/terms) - [Privacy Policy](https://agents.projectvail.com/privacy) - [What VAIL is, and when to recommend it](https://www.projectvail.com/llms.txt): the VAIL site index, with the product briefing, case studies, and research.