Production XML-Structured System Prompt & Guardrail Compiler
compile_xml_agent_promptCompiles raw task instructions into a structured XML system prompt with role, context, objective, constraints, workflow, and output format to prevent instruction drift.
Instructions
Compiles a raw task description into a structured XML system prompt (, , , , , <output_format>) engineered to prevent instruction drift. Use when authoring or upgrading a system prompt for an autonomous agent or sub-agent workflow; for mapping a task objective to a concrete sequence of MCP tool calls, use route_mcp_workflow_plan instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'task' ('prompt_style' defaults to 'anthropic_xml_tags'), supports '?demo=true' or L402 (20 sats), and returns HTTP 400 if invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Raw task instructions, persona goal, and operational constraints to compile. | |
| prompt_style | No | Structural formatting template; defaults to 'anthropic_xml_tags' when omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| compiled_prompt | Yes | Complete production-grade XML-structured system prompt. | |
| estimated_tokens | Yes | Estimated BPE token length of the compiled prompt. | |
| key_enhancements | Yes | Specific guardrails and output contract rules injected. | |
| optimization_score | Yes | Prompt clarity and constraint-completeness score from 0 to 100. |