Decision template · agent tool call risk API
Unofficial community documentation
Agent tool-call risk check API
Gate a proposed agent tool call: allow / confirm / block with risk score and destructive flag. Hosted Laya System One template for agent safety.
POST https://api.layaaimodel.com/v1/agent/risk
When to use it
Before an agent runs bash, cloud CLIs, or payment tools — you need a structured risk gate on the proposed call, not a chat rationale after the damage.
Agent frameworks that auto-execute tool calls need a policy checkpoint. Keyword denylists miss novel argument shapes; asking a large chat model “is this safe?” adds latency and free-text parsing. An agent tool call risk API that returns allow / confirm / block plus risk score plugs into LangGraph, custom workers, or your own planner loop.
Call it after the model proposes a tool invocation and before the runtime executes. confirm can mean human-in-the-loop; block drops the turn; allow proceeds. Log the JSON fields for audit. Keep option sets small — this is a System One gate, not a full policy engine.
Search intent sits on agent risk, tool-call approval, and agent safety APIs — smaller volume than jailbreak detection but high willingness to pay when agents touch production.
How the request works
POST goal, tool name, arguments, and context. Returns choice action (allow, confirm, block), ordinal risk, and a noul destructive flag in one decide pass. Same prepaid laya_ balance as other templates.
curl https://api.layaaimodel.com/v1/agent/risk \
-H "Authorization: Bearer laya_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"goal":"Clean up the build directory","tool":"bash","arguments":"rm -rf ./dist && aws s3 sync ./build s3://prod --delete","context":"CI deploy step"}'Questions you get back
Each id is a typed decision (choice / score / noul) — the System One shape, not a chat completion.
action (choice): Allow this tool call? [allow | confirm | block]
risk (score): Risk level? [low → medium → high → critical]
destructive (noul): Is this destructive to production data? [yes/no probability]Example result shape
rm -rf plus aws s3 sync --delete against prod should prefer confirm or block with high/critical risk and destructive=yes. A read-only ls in a workspace should allow with low risk.
action: confirm · 66%
risk: 2.4 · high
destructive: yes · 81%Live calibrated bars and a free anonymous try: open the homepage playground or the interactive tools runner.
Pricing & keys
Create a laya_ key on Account, buy prepaid packs on Pricing, or read the full decide reference under API docs. Output tokens are free; input is metered.