AI Discovery Policy

Update Enforcement Policy

Updates the AI Discovery enforcement policy for your organization.

Only the fields provided in the request body are updated. When rules is provided it replaces the entire ordered rule set — rules are ordered by their position in the array, and any rule without an id is assigned a generated one.

patch/api/discovery/policy

Request

  • Base URL: https://app.withwillow.ai
  • URL: https://app.withwillow.ai/api/discovery/policy
  • Auth: HTTP bearer

Request body

mcp_servers'allow' | 'warn' | 'block'

Default action for discovered MCP servers when no rule matches

skills'allow' | 'warn' | 'block'

Default action for discovered skills when no rule matches

capability_namesobject

Maps identity hashes to human-readable display names used in rules

Example request

{
  "mcp_servers": "warn",
  "skills": "allow",
  "rules": [
    {
      "name": "Block unknown filesystem MCP",
      "match_field": "hash",
      "target": "mcp_server",
      "action": "block"
    }
  ]
}

Response

Enforcement policy updated successfully

Example response

{
  "data": {
    "mcp_servers": "allow",
    "skills": "allow",
    "capability_names": {
      "9f2c1a7e5b3d4c8e6a1f0b2d3e4f5a6b": "filesystem"
    },
    "rules": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "Block unknown filesystem MCP",
        "match_field": "hash",
        "target": "mcp_server",
        "action": "block",
        "enabled": true,
        "status": "active",
        "scope_type": "group",
        "agents": [
          "cursor"
        ],
        "created_at": "2024-06-01T12:00:00Z",
        "created_by": "admin@example.com"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.