# AI Agents, MCP & Connect AI

OpenOps is built **agent-native**: external AI agents can discover capabilities from `https://openops.run`, authenticate with scoped workspace tokens, dry-run recovery plans, execute bounded recoveries, and retrieve independent verification receipts.

## Automatic Discovery Endpoints

Starting from the public URL `https://openops.run`, any agent can inspect:

- `GET /agents` — Human & agent "Agents — Start here!" onboarding page
- `GET /AGENTS.md` — Sanitized public agent guide
- `GET /llms.txt` and `GET /llms-full.txt` — Concise and full LLM-friendly indexes
- `GET /openapi.json` — Machine-readable OpenAPI 3.1 specification
- `GET /api/docs` — Interactive API documentation
- `GET /.well-known/agent-card.json` — Agent-to-Agent (A2A) capability card
- `POST /mcp` — Streamable HTTP Model Context Protocol (MCP) server

All public discovery endpoints are strictly sanitized and never expose private incidents, policies, or tenant data.

## MCP Tools & Scopes (`POST /mcp`)

Authenticate requests using a scoped workspace Bearer token (`Authorization: Bearer ops_agent_...`). Read scopes and effect scopes are strictly separated:

| Tool | Required Scope | Description |
|---|---|---|
| `objectives.list` | `objectives:read` | List workspace operational objectives and active policies |
| `objectives.create` | `objectives:write` | Compile a draft structured policy from an objective |
| `services.list` / `services.status` | `services:read` | Inspect connected services and live health/freshness |
| `incidents.list` / `incidents.get` | `incidents:read` | Read incidents, timelines, diagnosis, and action receipts |
| `recovery.plan` / `recovery.dry_run` | `recovery:plan` | Generate or simulate a recovery plan with zero side effects |
| `recovery.execute` / `recovery.cancel` | `recovery:execute` | Execute (with `idempotency_key`) or halt an authorized recovery |
| `verification.get` | `verification:read` | Retrieve independent postcondition verdict and evidence hash |
| `procedures.list` | `procedures:read` | List reviewed procedures available to the workspace |
| `events.subscribe` | `events:write` | Register a signed HTTPS callback subscription |
| `usage.get` | `usage:read` | Inspect plan entitlements, metered actions, and AI budgets |

## Universal Connect AI (`Connect AI`)

- Click **Connect AI** in the header (web or iOS) to link your own user-funded provider API keys (OpenAI, Anthropic, Google Gemini) through Open Group Connect AI.
- OpenOps never stores your raw provider API keys.
- Consumer AI subscriptions (ChatGPT, Claude.ai, Google AI Pro/Ultra) do not grant third-party API access; where applicable, monthly API credits included in your provider plan apply to your own API key.
- **Deterministic Fallback:** Core monitoring, grouping, policy enforcement, bounded recovery, and postcondition verification work reliably even when Connect AI is disconnected or at its budget limit.
