Trusera Agent
AI-generatedSummary
Execute a policy-enforced AI agent loop, evaluating each tool call against PII, prompt-injection, content-filter, and Cedar policies before execution, with enforcement mode determining block/warn/log behavior.
Inputs
- agentName (required) — Name for this agent in the Trusera platform
- text — The input prompt for the agent
- systemMessage — System message that sets the agent behavior
- enforcementMode — What happens when a tool call violates a policy
- policySource — Cedar policy source
- inlineCedarDsl — Cedar policy DSL for tool call evaluation
- enablePiiDetection — Whether to scan tool arguments for PII
- enablePromptInjection — Whether to detect prompt injection in tool arguments
- enableBrainMode — Whether to use an LLM to evaluate complex policies contextually (adds ~1s per tool call)
- brainApiKey — API key for the brain mode LLM (OpenAI-compatible)
- brainBaseUrl — Base URL for the brain mode LLM API
- brainModel — Model for AI-powered policy evaluation
- maxIterations — Maximum number of agent reasoning iterations
Output shape
Per input item returns {json: {output: blockReason|finalOutput, blocked: boolean, intermediateSteps: [], _trusera: {agentName, enforcement, decision, reason, toolCallsTotal, toolDebug}}, pairedItem: {item: index}}.
If a tool call is blocked, output contains blockReason and blocked: true; otherwise output contains final LLM output, blocked: false, and intermediate steps with brainAnalysis when enabled.
Examples
Example 1: Blocked tool call
enforcementMode: block, any policy violation halts the agent loop and returns a POLICY VIOLATION error to the LLM.
Example 2: Allowed execution with brain mode
enableBrainMode: true adds an LLM-powered contextual policy evaluation step (~1s per tool call) before tool execution.
