Skip to main content

Overview

The Policy Feedback Loop enables LLM-generated feedback when policy violations occur, allowing agents to self-correct their outputs through retry loops.

User Policy Feedback

Give users constructive guidance instead of hard blocking:

Agent Policy Feedback

Enable agents to self-correct when their output violates policies. The agent retries until its output is compliant:

How it Works

  1. Agent generates a response (e.g., a guide including cryptocurrency section)
  2. Agent policy detects a violation in the output
  3. Feedback is sent back to the agent explaining the violation
  4. Agent retries, generating a compliant response (e.g., guide without cryptocurrency)
  5. Agent policy passes — compliant output is returned
The agent_policy_feedback_loop parameter controls how many retry attempts are allowed before the agent gives up.

Async Support

Policy feedback loops work with async execution: