kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

HTTP API / Webhooks

Webhooks

9 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.

List webhook endpoints#

GET/v1/webhooksscope admin
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/webhooks \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Add an endpoint; the whsec_ signing secret is shown once#

POST/v1/webhooksscope admin
JSON body
urlrequiredstring
—
eventsarray of "sandbox.created" | "sandbox.deleted" | "sandbox.slept" | "sandbox.woke" | "sandbox.error" | "sandbox.killed" | "sandbox.oom" | "function.deployed" …
—
descriptionstring
—
Responses
201400401403
curl -s -X POST https://api.kosa8.com/v1/webhooks \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Stop sending, including retries#

DELETE/v1/webhooks/{id}scope admin
Parameters
idrequiredpath · string
Id
Responses
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/webhooks/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Recent deliveries#

GET/v1/webhooks/{id}/deliveriesscope admin
Parameters
idrequiredpath · string
Id
limitquery · integer
How many
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/webhooks/$SBX/deliveries \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Send a webhook.test event now#

POST/v1/webhooks/{id}/testscope admin
Parameters
idrequiredpath · string
Id
Responses
200401403
curl -s -X POST https://api.kosa8.com/v1/webhooks/$SBX/test \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Record an agent hook decision or session event from a developer's machine (kosa8 hooks install --cloud)#

POST/v1/agent-hooks/eventsscope sandboxes:write

The decision was made by kosa8's rules on the machine; the answer may only be stricter (a frozen organization refuses every call). agent.tool_call.blocked (deny or ask) and agent.tool_call.decided are recorded in the audit log and sent to webhooks that subscribe to them.

JSON body
eventrequiredobject
—
event.actionrequired"agent.tool_call.decided" | "agent.tool_call.blocked" | "agent.session.started" | "agent.session.stopped" | "agent.session.ended" | "agent.file.edited"
—
event.harnessrequired"claude-code" | "cursor" | "codex" | "gemini" | "copilot"
—
event.eventstring
—
event.toolstring
—
event.effect"allow" | "flag" | "ask" | "deny"
—
event.reasonstring
—
event.rulesarray of string
—
event.subjectstring
the command or path, clipped to 300 characters; never a file's contents
event.args_sha256string
—
event.sessionstring
—
event.cwdstring
—
event.mode"check" | "sandbox"
—
event.sandboxedboolean
—
Responses
200400401403
curl -s -X POST https://api.kosa8.com/v1/agent-hooks/events \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

The organization's agent hook policy, which `kosa8 hooks install --org` caches and decides with on each machine#

GET/v1/agent-hooks/policyscope sandboxes:read

Version 0 is the default policy (nothing changed). frozen: the organization is frozen, and every checked call is refused.

Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/agent-hooks/policy \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Replace the organization's agent hook policy#

PUT/v1/agent-hooks/policyscope admin

rules: [{id, effect: deny|ask|flag, tool, match, reason}] with tool and match regular expressions (RE2: no lookaround or backreferences) on the tool name and on the call's command, path or URL; disabled_rules turns built-in K8- rules off; fail: closed|open when a machine has no usable copy. Machines pick a change up within ttl_seconds.

JSON body
fail"closed" | "open"
—
ttl_secondsinteger
—
max_stale_secondsinteger
—
disabled_rulesarray of string
—
rulesarray of object
—
Responses
200400401403
curl -s -X PUT https://api.kosa8.com/v1/agent-hooks/policy \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Record agent hook decisions forwarded from a machine's audit log (kosa8 hooks install --org --forward-audit)#

POST/v1/agent-hooks/auditscope sandboxes:write

batch is the JSON of the forwarded entries (chain, seq, time, action, hash, event), signed with the machine's audit key (Ed25519 over "kosa8.hooks.forward/v1\n" + batch). Each entry is recorded once per chain and seq, and reaches the SIEM export with the rest of the audit log. Metadata only: never file contents or command output.

JSON body
batchrequiredstring
—
keyobject
—
sigstring
—
Responses
200400401403
curl -s -X POST https://api.kosa8.com/v1/agent-hooks/audit \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · AI Agent Sandbox: Secure and Sovereign for Enterprise · Local models served by llamay · Agent gateway: MAQPNA