---
title: "Find real incidents and safeguards for a planned design or existing app"
method: POST
path: "/api/analyze"
---

# Find real incidents and safeguards for a planned design or existing app

`POST /api/analyze`

## Request

- Base URL: `https://collectsea.com`
- URL: `https://collectsea.com/api/analyze`
- Auth: none declared

Profiles behavior signals in a design description or submitted existing-app context, retrieves analogous documented incidents and advisories, and returns safeguards. Call this before implementing features that move money, delete data, change permissions, run code, or let an AI agent act on external content.

## Request body

- union
  - object
    - `repository` object: Repository metadata returned by /api/app-context; preserve it alongside imported files.
      - `url` string, required
      - `revision` string, required
      - `selected_files` integer, required
      - `available_files` integer, required
      - `partial` unknown, required
    - `mode` 'design' | 'existing_app'
    - `files` object[]: Existing-app mode only. Combined description and file contents: at most 25,000 characters. Entire request: at most 32 KB. Text is not executed or crawled.
      - `name` string, required
      - `content` string, required
      - `origin` 'repository' | 'upload': Preserve repository origin from /api/app-context; mark additional local text as upload.
    - `proposal` string, required: What the system does: what it can change, what it reads, which services it calls.
    - `max_results` integer
    - `exclude_incident_ids` string[]
  - object
    - `mode` 'existing_app', required
    - `files` object[], required: Existing-app mode only. Combined description and file contents: at most 25,000 characters. Entire request: at most 32 KB. Text is not executed or crawled.
      - `name` string, required
      - `content` string, required
      - `origin` 'repository' | 'upload': Preserve repository origin from /api/app-context; mark additional local text as upload.
    - `repository` object: Repository metadata returned by /api/app-context; preserve it alongside imported files.
      - `url` string, required
      - `revision` string, required
      - `selected_files` integer, required
      - `available_files` integer, required
      - `partial` unknown, required
    - `proposal` string: What the system does: what it can change, what it reads, which services it calls.
    - `max_results` integer
    - `exclude_incident_ids` string[]

## Response `200`

Analysis result

- object
  - `analysis_id` string
  - `input_context` object
    - `mode` 'design' | 'existing_app'
    - `sources` object[]
      - `name` string
      - `characters` integer
    - `limitations` string
  - `profile` object
  - `matches` object[]
    - `incident` object
    - `composite_score` number
    - `why_analogous` string
    - `lessons` object[]
  - `top_lessons` object[]
    - `title` string
    - `statement` string
    - `actionable_rule` string
    - `supporting_incident_ids` string[]
  - `coverage` object
    - `status` 'strong' | 'partial' | 'none'
    - `message` string
  - `metadata` object

## Other responses

- `400`: Invalid request
- `413`: Proposal too long
- `429`: Rate limited

---

[API](https://skmtc.dev/collectsea/apis/collectsea-api.md) · [All operations](https://skmtc.dev/collectsea/apis/collectsea-api/llms.txt) · [OpenAPI document](https://skmtc.dev/collectsea/apis/collectsea-api/revisions/58878bb2ba05?raw)
