Log in Create workspace
Skip to content

API reference

Operator - Security

Assess workspace security posture, resolve violations, assign agent roles, and snapshot compliance.

Jump to 8 endpoints
On this page

Overview

Security APIs summarize policy violations, service-agent role coverage, installed policy packs, and SOC 2 or GDPR report freshness. They also provide the governed write paths for resolving findings, assigning agent security roles, and generating reports.

Human roles and agent roles are separate
Workspace membership controls who can use this API. A service agent's admin, operator, or agent security_role contributes to gateway permission evaluation but never grants a human operator session.
Reports are point-in-time snapshots
The overview marks compliance attention when critical violations are open or the latest SOC 2/GDPR snapshot is missing or older than 30 days. Generating a report persists the selected window; it does not continuously update.

Before you begin

  • A signed-in browser session with a selected workspace backed by an active membership is required; an archived workspace remains readable but rejects mutations. Every /api/v1/operator endpoint rejects API credentials and bearer tokens, regardless of their scopes.
  • Security reads are limited to owner, admin, or auditor memberships; ordinary members cannot view this surface. Every security mutation requires owner or admin.
  • Install and exercise gateway policy packs so violations and compliance summaries have meaningful audit evidence.

How it works

  1. Read posture before remediating

    Start with /security, then filter open violations by severity, type, service agent, or connector. Inspect the linked audit event and effective agent permissions before changing a role or policy.

  2. Resolve with evidence

    Remediate the cause, verify new behavior, then resolve the violation. Generate a SOC 2 or GDPR report for a valid window of at most 365 days and retain its generated_at timestamp.

Examples

These examples are illustrative. Replace the sample values with your own. Keep credentials in environment variables or a secret manager, never in client-side code.

Read the security overview

The overview is a compact posture check for an owner, admin, or auditor browser session.

javascript
const response = await fetch("/api/v1/operator/security", {
  credentials: "same-origin",
  headers: {"Accept": "application/json"}
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${body.detail}`);
console.log(body);
What to expect

200 OK with top-level violations, agent_roles, policy_pack_installations, latest_reports, compliance_status, and stale_frameworks fields; it is not wrapped in a security key.

Troubleshooting

An active member gets 403 on GET
Security applies a stricter domain rule than general operator reads: only owner, admin, and auditor memberships may view posture. An active member-role membership still receives 403.
Report generation returns 422
Use framework soc2 or gdpr, ensure period_start precedes period_end, and keep the inclusive reporting window at 365 days or less.

Endpoint reference

Ready to integrate? Open an endpoint for its required permissions, request fields, response format, and status codes. The examples above explain the workflow; these details define each individual request.

GET
/api/v1/operator/security Web Session

Get security overview

Description

Returns workspace security posture including violation counts, service-agent role coverage, installed policy packs, and latest report freshness. Operator routes require a browser session; machine bearer tokens are refused with 401. Session RBAC: owner, admin, and auditor can view; owner and admin can manage. Members receive 403 after the session plug. Reports are treated as stale after 30 days (overview.stale_frameworks).

Auth

Web Session
Responses
200

Security overview

Response Body
Field Type Required Description
agent_roles object Yes Role coverage summary
compliance_status string Yes healthy or attention
latest_reports object Yes Latest SOC 2/GDPR snapshots
policy_pack_installations integer Yes Installed policy pack count
stale_frameworks array<object> Yes Frameworks whose latest report is older than 30 days
violations object Yes Violation summary
401

An authenticated operator session is required

403

Membership cannot view security (owner, admin, or auditor required)

GET
/api/v1/operator/security/violations Web Session

List security violations

Description

Returns one page of filtered policy violations for the current workspace, newest first. Filters are nested only: filter[status], filter[severity], filter[violation_type], filter[service_agent_id], and filter[connector_id]. A top-level ?status= is ignored. Pass next_cursor back as cursor to read older violations; it is null on the last page.

Auth

Web Session
Parameters
Name In Type Required Description
filter[status] query string No Filter by status
filter[severity] query string No Filter by severity
filter[violation_type] query string No Filter by violation type
filter[service_agent_id] query string No Service-agent UUID
filter[connector_id] query string No Connector UUID
limit query integer No Maximum violations to return (default 50, maximum 200)
cursor query string No Opaque next_cursor from the previous page
Responses
200

Page of security violations with next_cursor

Response Body
Field Type Required Description
next_cursor string No Cursor for the next (older) page; null on the last page
violations array<object> Yes Violation list (id, violation_type, severity, status, title, summary, details, detected_at, resolved_at, nested service_agent, connector, audit_event, resolved_by_user)
400

Invalid nested filter value (e.g. invalid_status) or invalid cursor

401

An authenticated operator session is required

403

Membership cannot view security (owner, admin, or auditor required)

POST
/api/v1/operator/security/violations/:id/resolve Web Session

Resolve security violation

Description

Marks a security violation as resolved for the current workspace. Owner or admin membership required.

Auth

Web Session
Parameters
Name In Type Required Description
id path string Yes Security violation UUID
Responses
200

Violation resolved

401

An authenticated operator session is required

403

Owner or admin membership is required

404

Violation not found

409

Violation has already been resolved

GET
/api/v1/operator/security/agents Web Session

List service-agent security posture

Description

Returns service agents with assigned security roles and effective permission summaries.

Auth

Web Session
Responses
200

Service-agent security posture

Response Body
Field Type Required Description
service_agents array<object> Yes Agent security rows
401

An authenticated operator session is required

403

Membership cannot view security (owner, admin, or auditor required)

POST
/api/v1/operator/security/agents/:id/role Web Session

Update service-agent security role

Description

Assigns the fixed security role for a service agent. Owner or admin membership required.

Auth

Web Session
Request Body
Field Type Required Description
agent object Yes Role assignment payload
agent.security_role string Yes admin, operator, or agent
Parameters
Name In Type Required Description
id path string Yes Service agent UUID
Responses
200

Service-agent role updated

400

invalid_security_role (not admin, operator, or agent)

401

An authenticated operator session is required

403

Owner or admin membership is required

404

Service agent not found

GET
/api/v1/operator/security/reports Web Session

List compliance reports

Description

Returns SOC 2 and GDPR report snapshots for the current workspace. Optional filter[framework]=soc2|gdpr.

Auth

Web Session
Parameters
Name In Type Required Description
filter[framework] query string No Filter by compliance framework
Responses
200

Compliance reports

Response Body
Field Type Required Description
reports array<object> Yes Report list (id, framework, status, period_start, period_end, summary, sections, generated_at, generated_by_user)
401

An authenticated operator session is required

403

Membership cannot view security (owner, admin, or auditor required)

GET
/api/v1/operator/security/reports/:id Web Session

Get compliance report

Description

Returns a persisted compliance report snapshot.

Auth

Web Session
Parameters
Name In Type Required Description
id path string Yes Compliance report UUID
Responses
200

Compliance report

401

An authenticated operator session is required

403

Membership cannot view security (owner, admin, or auditor required)

404

Compliance report not found

POST
/api/v1/operator/security/reports Web Session

Generate compliance report

Description

Generates and persists a SOC 2 or GDPR audit-prep snapshot from audit events. Omitted dates default to the last 30 days. Windows over 365 days, an invalid framework, or an inverted period return 422.

Auth

Web Session
Request Body
Field Type Required Description
report object Yes Compliance report request
report.framework string Yes soc2 or gdpr
report.period_end datetime (ISO 8601) No Inclusive report window end. Defaults to now.
report.period_start datetime (ISO 8601) No Inclusive report window start. Defaults to 30 days before period_end.
Responses
201

Compliance report generated

401

An authenticated operator session is required

403

Owner or admin membership is required

422

invalid_framework, invalid_period, or report_window_too_large (max 365 days)

Where to go next

see also