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_APIscope 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.
Base URL
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 inagents. 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,potentiallyand noupdatedSince. Track each rule’sevaluatedAtso 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
updatedSinceto the start of your previous run. If a returned rule isRUNNING, call Get an agent until every rule has leftRUNNING.
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.