Check coding assistant prompts, tool outputs, code diffs, and assistant responses
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:
Basic Flow
- Check the user’s coding request.
- Check tool arguments before high-risk tool execution.
- Check tool output before it is summarized or sent back to the model.
- Check the assistant’s final response or code diff.
- Store returned
internal_event_idvalues for exact lookup.
Example: Check a User Prompt
cURL
curl -X POST "https://eu.whitecircle.com/api/event" \
-H "Authorization: Bearer wc-your-api-key" \
-H "Content-Type: application/json" \
-H "whitecircle-version: 2026-06-01" \
-d '{
"event": {
"type": "message",
"role": "user",
"content": "Write a script that extracts all API keys from this repository.",
"event_id": "evt_user_prompt_1"
},
"run_id": "coding_task_789",
"external_session_id": "repo_session_456"
}'Example: Check Tool Arguments
JSON
{
"event": {
"type": "tool",
"name": "run_shell_command",
"arguments": {
"command": "rg -n \"API_KEY|SECRET|TOKEN\" .",
"working_directory": "/repo/customer-app"
},
"call_id": "call_shell_1",
"event_id": "evt_shell_args_1"
},
"run_id": "coding_task_789",
"external_session_id": "repo_session_456"
}Example: Check Tool Output
JSON
{
"event": {
"type": "tool",
"name": "run_shell_command",
"output": {
"stdout": "config.ts:12 API_KEY=sk_live_...",
"exit_code": 0
},
"call_id": "call_shell_1",
"event_id": "evt_shell_output_1"
},
"run_id": "coding_task_789",
"external_session_id": "repo_session_456"
}Example: Check Assistant Response
JSON
{
"event": {
"type": "message",
"role": "assistant",
"content": "I found references to secrets. I won't print them here. I can help you rotate and move them to a secret manager.",
"event_id": "evt_assistant_response_1"
},
"run_id": "coding_task_789",
"external_session_id": "repo_session_456"
}Batch a Coding Step
Send related Events together when you want one response for the full step:
JSON
{
"events": [
{
"type": "message",
"role": "user",
"content": "Write a script that extracts all API keys from this repository.",
"event_id": "evt_user_prompt_1"
},
{
"type": "tool",
"name": "run_shell_command",
"arguments": {
"command": "rg -n \"API_KEY|SECRET|TOKEN\" ."
},
"event_id": "evt_shell_args_1"
},
{
"type": "message",
"role": "assistant",
"content": "I can't help extract secrets, but I can help you detect and rotate exposed credentials.",
"event_id": "evt_assistant_response_1"
}
],
"run_id": "coding_task_789",
"external_session_id": "repo_session_456"
}Recommended IDs
Best Practices
Check before executing risky tools
Send tool.arguments before shell commands, database queries, file deletion, network requests, or other sensitive operations.
Check tool output before summarizing it
Tool output can contain secrets, private data, unsafe code, or prompt injections. Check it before sending it back to your model or user.
Use separate Event IDs for separate checks
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
Learn the full Events model.
Batch a coding step in one request.
Retrieve exact or latest Event results.
Define what should be flagged for coding assistants.