--- name: compile-evidence-sop description: Use the Agent SOP Compiler x402 API to compile inline source evidence into machine-readable draft SOPs, validate exact quote citations, or adversarially execution-test and harden a draft. Trigger when an agent needs an auditable procedure, checklist, evidence-linked workflow, citation validation, ambiguity analysis, failure-path testing, or safety hardening from supplied text. --- # Agent SOP Compiler Use this service only for source text the caller is authorized to submit. Never include credentials, private keys, access tokens, personal secrets, or unredacted sensitive records. ## Discover - Agent card: https://agent-sop-compiler-production.up.railway.app/.well-known/agent.json - OpenAPI: https://agent-sop-compiler-production.up.railway.app/openapi.json - Compile: POST https://agent-sop-compiler-production.up.railway.app/v1/compile ($2.00) - Validate: POST https://agent-sop-compiler-production.up.railway.app/v1/validate ($0.25) - Harden: POST https://agent-sop-compiler-production.up.railway.app/v1/harden ($1.00) - Payment: x402 on eip155:8453 ## Compile a draft Send JSON shaped like: ```json { "title": "Refund review", "requestedFormat": "sop", "sources": [ { "id": "policy-1", "name": "Refund policy", "content": "Verify the order number before reviewing eligibility. Record the approval decision." } ] } ``` Make the request with an x402-capable HTTP client. On `402 Payment Required`, inspect the advertised payment option, enforce the buyer's network and spend limits, sign outside the prompt or logs, and retry with the x402 payment header. Never expose a wallet private key to this service. Send a random `Idempotency-Key` header of 16-128 characters. Reuse that key only when retrying the exact same body; using it with a different body returns `409`. Accept a `200` response only when `validation.valid` is `true`. Treat every returned document as `draft_requires_human_approval`; the service does not authorize real-world actions. ## Validate a draft POST a `document` previously returned by the compiler together with the original `sources`. A valid result requires every procedural step to retain an exact quote found in the referenced source. ## Execution-test and harden a draft POST a compiled `document` with its original `sources`. Optional fields are `objective`, `constraints`, and `scenarioCount` from 3 to 12. The response reports ambiguity, missing information, unsafe actions, missing authority, failure recovery, verification gaps, and scenario outcomes. It also returns conservative proposed controls, a proposed draft, evidence validation for the original and proposed documents, and a SHA-256 integrity hash. Treat `deploymentRecommendation=block` or `revise` as a hard stop. Even `ready_for_human_approval` is not authorization to execute; every output remains a draft requiring human approval. ## Failure handling - `402`: payment is required; do not retry without checking price and network. - `413`: reduce the request below the advertised size limit. - `422`: correct invalid input or remove likely secrets. - `429`: back off before retrying. - `502` or `504`: treat as a temporary upstream model failure; do not assume payment or work succeeded without a valid response.