Guardrail triggers

Package: agentrouter.guardrails.v1 Service: GuardrailTriggersService

Endpoints

List guardrail trigger events

Changed in v0.7.0 (new features): Every guardrail rule now carries a reference, a short read-only id such as GR-0142 that the database mints once and never rewrites. The guardrail rule APIs and each trigger evaluation return it beside the display_name, and the data plane receives it in its runtime configuration, so a platform operator reading a trigger has one id to quote. Existing rules were numbered in creation order, and a blocked caller's refusal body does not carry the reference yet.

Changed in v0.7.0 (new features): A guardrail trigger now reports one verdict for the whole event, which is blocked, redacted or would-have, resolved from its rule evaluations so an enforced block outranks an enforced redact and either outranks a monitor-mode hit that changed nothing. ListGuardrailTriggers filters on verdicts and returns a count for each one. The counts answer every filter on the request except verdicts itself, so a console showing the three as peers keeps all three counts on screen after a reader picks one.

What it does: Lists trigger events matching the specified filters.

Request fields:

FieldRequiredDescription
customer_idnoOwning customer scope; defaults to caller's session customer when empty.
project_idnoOwning project scope; defaults to caller's session project when empty.
pagenoCursor-pagination inputs.
guardrail_idsnoFilter to events for these guardrail ids.
consumer_idsnoFilter to events for these consumer ids.
resource_idsnoFilter to events for these resource ids.
date_fromnoInclusive start of the time range to query.
date_tonoInclusive end of the time range to query.
min_execution_duration_msnoFilter to events with execution_duration_ms >= this value.
max_execution_duration_msnoFilter to events with execution_duration_ms <= this value.
guardrail_typesnoFilter to events for guardrails of these types.
exclude_guardrail_typesnoExclude events for guardrails of these types.
verdictsnoFilter to events whose verdict is one of these (tetrateio/fraser#9667). Empty returns every verdict, and TRIGGER_VERDICT_UNSPECIFIED entries are ignored rather than matching the events that resolved to no verdict. A value the server does not know is refused with INVALID_ARGUMENT.

Response fields:

FieldRequiredDescription
triggersnoTrigger events matching the request filters, one page's worth.
pagenoCursor-pagination outputs.
totalnoTotal count of matching triggers across all pages.
verdict_countsnoHow many events resolved to each verdict, one entry per verdict including the ones that matched nothing (tetrateio/fraser#9667). Counted against every filter on the request EXCEPT verdicts, and total above obeys verdicts like the page does. A console renders the three verdicts as peers a reader picks between, so picking one must not drive the other two counts to zero and strand the reader on the filter they just chose. The three counts sum to at most the unfiltered total, since an event that resolved to no verdict is in none of them.
{"signatures":{"go":"c.GuardrailTriggers().ListGuardrailTriggers(ctx, \u0026guardrailsv1.ListGuardrailTriggersRequest{...})","python":"client.guardrailtriggers.listguardrailtriggers(...)","typescript":"client.guardrailtriggers.listguardrailtriggers({...})","cli":"tare api guardrails triggers list","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../guardrails/triggers\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","cli":"tare api guardrails triggers list","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../guardrails/triggers\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Authenticated (API key or session token)","httpVerb":"GET","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/guardrails/triggers","slug":"list-guardrail-trigger-events"}

Get a guardrail trigger event

Changed in v0.7.0 (new features): Every guardrail rule now carries a reference, a short read-only id such as GR-0142 that the database mints once and never rewrites. The guardrail rule APIs and each trigger evaluation return it beside the display_name, and the data plane receives it in its runtime configuration, so a platform operator reading a trigger has one id to quote. Existing rules were numbered in creation order, and a blocked caller's refusal body does not carry the reference yet.

Changed in v0.7.0 (new features): A guardrail trigger now reports one verdict for the whole event, which is blocked, redacted or would-have, resolved from its rule evaluations so an enforced block outranks an enforced redact and either outranks a monitor-mode hit that changed nothing. ListGuardrailTriggers filters on verdicts and returns a count for each one. The counts answer every filter on the request except verdicts itself, so a console showing the three as peers keeps all three counts on screen after a reader picks one.

What it does: Returns a single trigger event by id.

Request fields:

FieldRequiredDescription
customer_idnoOwning customer scope; defaults to caller's session customer when empty.
project_idnoOwning project scope; defaults to caller's session project when empty.
idyesRequired: id of the trigger event to fetch.

Response fields:

FieldRequiredDescription
triggernoThe requested guardrail trigger event.
{"signatures":{"go":"c.GuardrailTriggers().GetGuardrailTrigger(ctx, \u0026guardrailsv1.GetGuardrailTriggerRequest{...})","python":"client.guardrailtriggers.getguardrailtrigger(...)","typescript":"client.guardrailtriggers.getguardrailtrigger({...})","cli":"tare api guardrails triggers get \u003cid\u003e","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../guardrails/triggers/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","cli":"tare api guardrails triggers get \u003cid\u003e","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../guardrails/triggers/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Authenticated (API key or session token)","httpVerb":"GET","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/guardrails/triggers/{id}","slug":"get-a-guardrail-trigger-event"}

Get guardrail trigger statistics

What it does: Returns aggregate statistics for trigger events in scope.

Request fields:

FieldRequiredDescription
customer_idnoOwning customer scope; defaults to caller's session customer when empty.
project_idnoOwning project scope; defaults to caller's session project when empty.

Response fields:

FieldRequiredDescription
total_triggersnoTotal number of trigger events in scope.
avg_execution_time_msnoAverage execution time across all triggers, in milliseconds.
top_consumersnoRanked list of consumers by trigger count.
top_resourcesnoRanked list of resources by trigger count.
top_guardrailsnoRanked list of guardrails by trigger count.
time_distributionnoTime-series distribution of trigger counts.
{"signatures":{"go":"c.GuardrailTriggers().GetGuardrailTriggerStats(ctx, \u0026guardrailsv1.GetGuardrailTriggerStatsRequest{...})","python":"client.guardrailtriggers.getguardrailtriggerstats(...)","typescript":"client.guardrailtriggers.getguardrailtriggerstats({...})","cli":"tare api guardrails triggers stats","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../guardrails/triggers/stats\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","cli":"tare api guardrails triggers stats","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../guardrails/triggers/stats\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Authenticated (API key or session token)","httpVerb":"GET","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/guardrails/triggers/stats","slug":"get-guardrail-trigger-statistics"}

Get guardrails dashboard summary

What it does: Returns a combined summary of guardrail posture and recent trigger activity for the dashboard view.

Request fields:

FieldRequiredDescription
customer_idnoOwning customer scope; defaults to caller's session customer when empty.
project_idnoOwning project scope; defaults to caller's session project when empty.

Response fields:

FieldRequiredDescription
guardrailsnoSummary of guardrails configured in scope.
eventsnoSummary of trigger events recorded in scope.
{"signatures":{"go":"c.GuardrailTriggers().GetDashboard(ctx, \u0026guardrailsv1.GetDashboardRequest{...})","python":"client.guardrailtriggers.getdashboard(...)","typescript":"client.guardrailtriggers.getdashboard({...})","cli":"tare api guardrails dashboard","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../guardrails/dashboard\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for GuardrailTriggersService yet -- use the CLI or curl example below.","cli":"tare api guardrails dashboard","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../guardrails/dashboard\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Authenticated (API key or session token)","httpVerb":"GET","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/guardrails/dashboard","slug":"get-guardrails-dashboard-summary"}