{
  "openapi": "3.1.0",
  "info": {
    "title": "Excession Labs agent API",
    "version": "2.0.0",
    "description": "Agent access to Excession Labs, a security lab: register an agent key, then send a security test request for a person who asked for one. Authentication: https://excessionlabs.ai/auth.md."
  },
  "servers": [
    {
      "url": "https://excessionlabs.ai"
    }
  ],
  "externalDocs": {
    "url": "https://excessionlabs.ai/docs/"
  },
  "paths": {
    "/agent/auth": {
      "servers": [
        {
          "url": "https://excessionlabs.ai"
        }
      ],
      "post": {
        "operationId": "registerAgentKey",
        "summary": "Get a free agent key for security test requests",
        "description": "Anonymous registration. Returns an exl_agent_ bearer key for the MCP tool request_security_test and POST /api/agent/request. The key is not an API key for models. Revoke it with DELETE /agent/auth.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "agent_name"
                ],
                "properties": {
                  "agent_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Name of the agent or client"
                  },
                  "contact": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Optional contact for the agent's operator"
                  },
                  "identity_type": {
                    "type": "string",
                    "enum": [
                      "anonymous"
                    ],
                    "description": "Only anonymous is supported"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Key issued; access_token is shown once"
          },
          "400": {
            "description": "agent_name missing"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      },
      "delete": {
        "operationId": "revokeAgentKey",
        "summary": "Revoke the agent key sent in the Authorization header",
        "security": [
          {
            "agentKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked"
          },
          "401": {
            "description": "Unknown key"
          }
        }
      }
    },
    "/api/agent/request": {
      "servers": [
        {
          "url": "https://excessionlabs.ai"
        }
      ],
      "post": {
        "operationId": "requestSecurityTest",
        "summary": "Request a security test for a person who asked for one",
        "description": "Same as the MCP tool request_security_test. Excession Labs replies to the person by email to agree scope; testing starts only after a written scope and written authorization from the system owner. Limits: 5 requests a day per key, 3 a day per email address.",
        "security": [
          {
            "agentKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "test_type",
                  "targets",
                  "person_consent",
                  "authorized"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "The person's name"
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "The person's work email; Excession Labs replies here"
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 160,
                    "description": "The person's company or organization name"
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 300,
                    "description": "Company website"
                  },
                  "test_type": {
                    "type": "string",
                    "enum": [
                      "web_app",
                      "api",
                      "saas_multi_tenant",
                      "ai_application",
                      "other"
                    ],
                    "description": "Kind of test"
                  },
                  "targets": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "minItems": 1,
                    "maxItems": 10,
                    "description": "Systems to test: URLs, API base URLs or short descriptions. No credentials."
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "customer_request",
                      "compliance",
                      "launch",
                      "routine",
                      "incident",
                      "other"
                    ],
                    "description": "Why the person needs the test"
                  },
                  "timeline": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "When the person needs the result, in their words"
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Other context. No credentials or customer data."
                  },
                  "person_consent": {
                    "type": "boolean",
                    "const": true,
                    "description": "The person asked for this request and agreed to be contacted by email"
                  },
                  "authorized": {
                    "type": "boolean",
                    "const": true,
                    "description": "The person owns these systems or may arrange a test of them"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Request stored; returns a reference and next steps"
          },
          "401": {
            "description": "Agent key missing or revoked"
          },
          "422": {
            "description": "Field errors"
          },
          "429": {
            "description": "Rate or daily limit reached"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque API key"
      },
      "agentKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "exl_agent_ key from POST https://excessionlabs.ai/agent/auth"
      }
    }
  }
}
