Articles in this section

Monitor AI agent and guardrail activity with execution logs

This article explains how to view and use logs related to AI agents and Guardrails in your environment. When you use AI agents and guardrails, you can track exactly what happened during a request using Execution logs. Logs help you:

  • Trace a request from start to finish

  • Understand why an agent responded a certain way

  • See whether guardrails allowed or blocked content

  • Identify errors and retries

  • Monitor token usage and AI credit consumption

The log data captured by log level is available in your standard logging tools available in your Run history page and can be searched using a trace key, timestamp, or agent name.

Best practice

  • Keep basic logging enabled at all times so you always have visibility into activity, usage, and policy outcomes.

  • Turn on detailed logging only when you need deeper diagnostics. This approach gives you clear, actionable insight into how your agents and guardrails behave while keeping production environments efficient and controlled.

  • With structured logging in place, you can confidently monitor, debug, and optimise your agents and guardrails using the same tools and standards you already rely on.

Logs for AI agents

When you trigger an agent, you can see the following:

  • Invocation details: Agent name, trace ID, timestamp, and triggering flow or source.

  • LLM generation details: Model used, request duration, input and output token counts, and credit usage.

  • Tool calls: Tool name, input and output summary, success or failure status, retry attempts, and cost (if applicable).

  • Errors and recovery: Error type, retry attempts, and final outcome.

  • Detailed logging only (optional): Full prompt content, full model output, and internal reasoning traces.

You can view three levels of logging depending on how much detail you need.

Basic logging (default)

This level gives you everything required for monitoring and production support. You can see:

  • When an agent is invoked it captures agent name, timestamp, trace key, model used, service tier

  • Token and credit usage - input, output, total tokens, credits consumed, model parameters

  • Tool usage - which tool ran, status, success/failure, cost

  • Errors - error type and occurrence details

Use this level to:

  • Monitor production activity

  • Track usage and cost

  • Investigate failures

  • Confirm that requests completed successfully

Detailed logging (opt-in)

Enable this only when you need deep troubleshooting or behavioural analysis. In addition to basic logs, you can see:

  • Agent reasoning trace - how the agent reached its decision

  • Tool execution trace - tool inputs/outputs, retries, validation results, fallback behavior

  • Model output - full generated and processed responses

  • Raw LLM request and response

This level may include sensitive content and should only be enabled in controlled environments.

Debug mode

When debug mode is enabled, detailed execution logs are generated for all configured agents hooks (e.g., pre-map, mapping, and post-map hooks).

Logs for guardrails

Guardrails logs help you verify policy enforcement and understand decision outcomes. When Guardrails are evaluated, you can see:

  • Evaluation details: Guardrails policy name, trigger conditions, and input context.

  • Decision results: Pass or fail result and decision timestamp

  • Violations: Rule violated, severity level, and action taken.

  • Enforcement actions: Corrective action executed and outcome status.

  • Detailed logging only (optional): Rule evaluation reasoning and additional context metadata.

You control the level of detail you see.

Basic logging (default)

You can see the following:

  • Which guardrails policy was evaluated

  • Whether the request passed or failed

  • Any violations detectedSeverity level

  • Enforcement action takenFinal outcome

Use this level to:

  • Confirm compliance behaviour

  • Understand why content was blocked or modified

  • Monitor policy effectiveness

Detailed logging (opt-in)

This level includes everything in basic logging plus full evaluation detail. It should only be enabled under strict governance controls. When enabled, you can also see:

  • Detailed rule evaluation reasoning

  • Guardrail (PII)

  • Guardrail (Moderation)

  • Guardrails (AI agent/custom)

  • Additional evaluation context

  • Full raw request sent to guardrails

  • Full raw response returned by guardrails

Enable this only when investigating unexpected policy behaviour.

Debug mode

When debug mode is enabled, detailed execution logs are generated for all configured guardrail hooks (e.g., pre-map, mapping, and post-map hooks).