{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentInterceptor reference API (local only)",
    "version": "0.2.0",
    "description": "Reference-only API implemented by runtime/serve.py. It has no authentication, no production data and no availability commitment. The proposed production control API remains a separate contract in contracts/control-api.openapi.yaml.",
    "license": {
      "name": "Prototype content; no commercial license granted"
    }
  },
  "servers": [
    {
      "url": "http://127.0.0.1:8080",
      "description": "Local reference server only"
    }
  ],
  "tags": [
    {
      "name": "reference",
      "description": "Local evaluation surface"
    }
  ],
  "paths": {
    "/api/v1/guides": {
      "get": {
        "operationId": "guides_list",
        "summary": "List public field guides",
        "description": "Return the public technical guide index with titles, paths, summaries and last-verified dates. Reference implementation only; no authentication.",
        "tags": [
          "knowledge"
        ],
        "x-capability-id": "agentinterceptor.guides.list",
        "x-status": "implemented_static",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          }
        ]
      }
    },
    "/api/v1/guides/{slug}": {
      "get": {
        "operationId": "guides_read",
        "summary": "Read a public field guide",
        "description": "Return one public guide as Markdown or structured JSON, including its sections and limitations. Reference implementation only; no authentication.",
        "tags": [
          "knowledge"
        ],
        "x-capability-id": "agentinterceptor.guides.read",
        "x-status": "implemented_static",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/answers": {
      "get": {
        "operationId": "answers_read",
        "summary": "Read or search answer records",
        "description": "Return concise, scoped answers with detailed explanations, source routes and evidence notes. Reference implementation only; no authentication.",
        "tags": [
          "knowledge"
        ],
        "x-capability-id": "agentinterceptor.answers.read",
        "x-status": "implemented_static",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5
            }
          }
        ]
      }
    },
    "/api/v1/capabilities": {
      "get": {
        "operationId": "capabilities_list",
        "summary": "List declared capabilities",
        "description": "Return the capability catalog with human routes, machine routes, schemas and implementation status. Reference implementation only; no authentication.",
        "tags": [
          "discovery"
        ],
        "x-capability-id": "agentinterceptor.capabilities.list",
        "x-status": "implemented_static",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "implemented_static",
                "implemented_local",
                "synthetic_local",
                "contract_only",
                "not_implemented"
              ]
            }
          }
        ]
      }
    },
    "/api/v1/simulate": {
      "get": {
        "operationId": "policy_simulate",
        "summary": "Simulate a synthetic policy decision",
        "description": "Evaluate one of three synthetic operations against a local example policy. Never forwards, executes or persists real actions. Reference implementation only; no authentication.",
        "tags": [
          "simulation"
        ],
        "x-capability-id": "agentinterceptor.policy.simulate",
        "x-status": "synthetic_local",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "demo.read",
                "demo.export",
                "demo.deploy"
              ]
            }
          }
        ]
      }
    },
    "/api/v1/evidence/{evidenceId}": {
      "get": {
        "operationId": "evidence_read",
        "summary": "Read a synthetic execution receipt",
        "description": "Return the synthetic receipt emitted for a local tools/call. Receipts are in memory and reset when the reference server stops. Reference implementation only; no authentication.",
        "tags": [
          "evidence"
        ],
        "x-capability-id": "agentinterceptor.evidence.read",
        "x-status": "implemented_local",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "evidenceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Local reference server health",
        "responses": {
          "200": {
            "description": "Healthy"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp_jsonrpc",
        "summary": "Local MCP JSON-RPC endpoint",
        "description": "Bounded JSON-RPC 2.0 subset for the local reference server. No authentication; localhost only.",
        "x-protocol": "JSON-RPC 2.0",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "integer"
                    ]
                  },
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "400": {
            "description": "Invalid request"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "status"
        ]
      }
    }
  },
  "security": [],
  "x-status": "reference-only"
}
