Skip to main content
Coding assistants can receive unsafe user requests, expose secrets through tool output, or generate code that violates your Policies. Use the Events API to check each important step separately.

What to Check

For a coding assistant, send Events for:
Use Events to check the exact piece of the coding workflow you care about. For example, check tool.arguments before running a shell command and tool.output before feeding results back into the model.
Before using these examples, attach your coding Policies to an active Condition. Use an empty {} expression to match every coding Event, or add metadata to each Event to select different Policies based on the repository, tool risk, model, or workflow stage. Without a matching Condition, no Policies and Metrics are evaluated for that Event.

Basic Flow

  1. Check the user’s coding request.
  2. Check tool arguments before high-risk tool execution.
  3. Check tool output before it is summarized or sent back to the model.
  4. Check the assistant’s final response or code diff.
  5. Store returned internal_event_id values for exact lookup.

Example: Check a User Prompt

Example: Check Tool Arguments

Example: Check Tool Output

Example: Check Assistant Response

Batch a Coding Step

Send related Events together when you want one response for the full step:

Best Practices

Send tool.arguments before shell commands, database queries, file deletion, network requests, or other sensitive operations.
Tool output can contain secrets, private data, unsafe code, or prompt injections. Check it before sending it back to your model or user.
Give the user prompt, tool arguments, tool output, and assistant response different event_id values so you can inspect exactly what was flagged.

Next Steps

Events API

Learn the full Events model.

Check Multiple Events

Batch a coding step in one request.

Get Event Results

Retrieve exact or latest Event results.

Policies

Define what should be flagged for coding assistants.