Skip to main content

run_agent_loop

Function run_agent_loop 

Source
pub async fn run_agent_loop(
    llm: Arc<dyn LLMProviderTrait>,
    initial_prompt: &str,
    system_prompt: &str,
    config: AgentLoopConfig,
) -> Result<String>
Expand description

Run the agent loop with security integration (PolicyEngine + Sandbox + AuditLog)

This is the security-integrated version that:

  1. Checks all tool calls against PolicyEngine before execution
  2. Executes shell commands in the Sandbox
  3. Logs all tool calls, policy decisions, and results to AuditLog