Skip to main content
Read the review and compliance status of the agents in your workspace, and turn an agent off or back on with a stored reason. Use it when a ticketing tool or another system needs to react to that status. The API does not return an agent’s instructions, conversations, documents, or action results. For conversation content and tool results, use the Compliance API.

Before You Start

  • Governance is on: Turn on Enable Governance in Settings > Workspace > Products > Governance.
  • API key scope: A workspace admin creates a workspace API key with the GOVERNANCE_API scope in Settings > Workspace > Products > API. In the key form this scope is Governance API, and it is available only when Governance is on. Turning it on asks the admin to confirm that anyone with the key can read governance status and disable agents, even without access to Governance. Personal API keys cannot hold this scope.
The workspace comes from the API key. You do not send a workspace id.

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Authentication

Available Endpoints

Archived agents and agent templates are left out. If Hide private resources in Governance is on, agents that have not been shared with anyone else are left out as well. Get and disable then return 404 for those agents.

The agent object

List, get, and disable all return this object. List wraps it in agents. Get and disable wrap one object in agent. reviewStatus is pending_review when nobody has decided yet. After a decision it is approved, internal_flag, or rejected. complianceStatus is one of: RUNNING and ERROR are not verdicts. They do not by themselves mark an agent high_risk or potentially. Each item in complianceRules has ruleId, ruleName, severity (LOW, MEDIUM, HIGH, CRITICAL), status (RUNNING, PASSING, FAILING, ERROR), reasoning, and evaluatedAt. Disabled and deleted rules are omitted. You only get the latest result for each rule.

Polling

There is no webhook. Poll List agents. updatedSince filters on the agent’s updatedAt. A compliance rule can finish later, without changing that timestamp. A poll that only uses updatedSince can see a rule as RUNNING and miss the later FAILING result.
  • Flagged agents. Call the list with complianceStatus=high_risk,potentially and no updatedSince. Track each rule’s evaluatedAt so you only act once. The API returns the latest result for each rule, so a result that was replaced between polls is no longer available.
  • New or edited agents. Set updatedSince to the start of your previous run. If a returned rule is RUNNING, call Get an agent until every rule has left RUNNING.

Errors

Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.