The Actions API gives human operators control over the remediation actions proposed by Sentinel’s LangGraph agent. Once an incident reachesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nicolas344/Sentinel-SoftServe/llms.txt
Use this file to discover all available pages before exploring further.
awaiting_approval status, an engineer can approve the action (executing it atomically), reject it (marking the incident failed), or postpone it (sending it back to analyzed for later review). All three endpoints require a Supabase JWT, and the caller’s identity is recorded in the approved_by field for audit purposes.
Allowed Commands
Sentinel enforces a strict command whitelist at execution time. The backend re-validates the command regardless of what is stored inproposed_action. The following command forms are accepted:
| Runtime | Allowed commands |
|---|---|
| Docker | docker restart <container>, docker logs <container> |
| Podman | podman restart <container>, podman logs <container> |
| Kubernetes | kubectl rollout restart deployment/<name> [-n <ns>] |
| Kubernetes | kubectl delete pod <pod-name> [-n <ns>] |
| Kubernetes | kubectl scale deployment/<name> --replicas=<0-10> [-n <ns>] |
| PostgreSQL | pg_stat_activity <datname> |
| PostgreSQL | pg_cancel_backend <datname> |
| PostgreSQL | pg_terminate_backend <datname> |
;, &&, |, `, $(, >, <) are rejected in all kubectl commands.
POST /api/execute-action
Execute the proposed remediation action for an incident. The endpoint enforces atomic single-execution to prevent duplicate runs. Auth required: YesUUID of the incident to act on.
The exact command to execute. Must match the incident’s
proposed_action field character-for-character. Maximum 200 characters.Execution Flow
Verify incident status
Checks that the incident is in
awaiting_approval. Returns 409 Conflict if not.Verify command match
Compares
command against the stored proposed_action. Returns 400 Bad Request if they differ.Atomic DB claim
Performs a conditional
UPDATE SET status = 'executing_solution' that only succeeds if the incident is still in awaiting_approval. Returns 409 Conflict if another process claimed it first. Records approved_by from the JWT.Route and execute
Routes to the correct execution branch based on
source_type and container_runtime:- PostgreSQL → psycopg2 direct connection
- Kubernetes → kubectl subprocess (with optional
K8S_PROXY_URL) - Podman → Docker SDK against the rootless Podman socket (
PODMAN_HOST) - Docker → subprocess
Response
UUID of the incident that was acted on.
Resulting incident status:
verifying on success, failed on execution error.Process exit code.
0 on success. Common failure codes: 124 (timeout), 127 (binary not found).Standard output from the command. For PostgreSQL commands, this is a JSON string containing query results.
Standard error output or error description.
Human-readable error summary, present only when
status is failed. Suitable for display in the UI.- Request
- Response (success)
- Response (failure)
- Response (409 – already executed)
POST /api/incidents//reject
Reject the proposed action, permanently closing the incident asfailed. Use this when the proposed action is unsafe, incorrect, or no longer relevant.
Auth required: Yes
UUID of the incident.
Optional reason for rejection. Maximum 500 characters. If omitted, defaults to
"Acción rechazada por el ingeniero." The comment is prefixed with [RECHAZADO] and stored in action_error.UPDATE only proceeds if the incident is still in awaiting_approval. If it has already moved to another status, 409 Conflict is returned. The caller’s identity is recorded in approved_by.
- Request
- Response
- Response (409)
POST /api/incidents//postpone
Postpone the proposed action, returning the incident toanalyzed status for later review. The proposed action and agent reasoning are preserved; the incident can be approved, rejected, or re-analyzed later.
Auth required: Yes
UUID of the incident.
Optional reason for postponement. Maximum 500 characters. If omitted, defaults to
"Acción pospuesta por el ingeniero." The comment is prefixed with [POSPUESTO] and stored in action_error.UPDATE only proceeds if the incident is still in awaiting_approval. Returns 409 Conflict if it has already moved. The caller’s identity is recorded in approved_by.
Unlike reject, postpone sets the status back to
analyzed rather than failed, leaving the door open for a future approval or re-triage.- Request
- Response
- Response (409)
Error Reference
| Status Code | Scenario |
|---|---|
400 | command does not match proposed_action, or command fails whitelist validation |
401 | Missing or invalid JWT |
404 | Incident UUID does not exist |
409 | Incident is not in awaiting_approval, or action was already claimed by a concurrent request |