{"openapi":"3.1.0","info":{"title":"ProofForge Agent API","version":"1.0.0","description":"Bounded passive checks of public website surfaces: free scan APIs, a $0.25 x402 outside-check endpoint, and optional one-time report upgrades. Only scan apps you own or are explicitly authorized to test. The scanner does not log in, write data, attempt authentication bypasses, or retain database row contents. Results are partial and are not a penetration test or proof that every access-control rule is safe."},"servers":[{"url":"\/","description":"ProofForge origin"}],"paths":{"\/api\/v1\/x402\/outside-check":{"get":{"operationId":"outsideSecurityCheck","summary":"Run a read-only outside check for $0.25 in Base USDC","description":"Read-only outside security check of a public AI-built app URL: leaked keys, open databases, headers. Returns grade, severity counts and a report link. No login or bearer token. Only submit an app you own or have explicit permission to test. A missing payment signature returns 402 even without url. Retrying the same URL and identical authorization returns the original result without another charge. This summary does not unlock any report tier.","security":[],"parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","format":"uri","pattern":"^https:\/\/","maxLength":2048},"example":"https:\/\/example.com","description":"Public HTTPS app URL; normal public-target admission, opt-outs and scan limits apply before settlement."},{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"schema":{"type":"string","maxLength":24000},"description":"Base64 x402 v2 exact EIP-3009 authorization for 250000 atomic USDC units on eip155:8453. Omit to discover the offer and Bazaar input\/output schemas."}],"responses":{"200":{"description":"Settled payment and completed full public-surface scan. The private report link retains normal paid-tier restrictions.","headers":{"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"Base64 JSON settlement receipt: success, transaction, network and payer."}},"content":{"application\/json":{"schema":{"type":"object","required":["grade","score","counts","report_url"],"properties":{"grade":{"type":"string"},"score":{"type":"integer","minimum":0,"maximum":100},"counts":{"type":"object","additionalProperties":{"type":"integer","minimum":0}},"report_url":{"type":"string","format":"uri"}}},"example":{"grade":"B","score":84,"counts":{"critical":0,"high":0,"medium":1,"low":2,"info":0,"inconclusive":0},"report_url":"https:\/\/proofforge.live\/r\/example-report"}}}},"202":{"description":"Payment or scan pending. Follow Retry-After and retry the identical URL and PAYMENT-SIGNATURE; do not sign another payment."},"400":{"description":"Signed request has a missing, invalid, private or opted-out target. No settlement."},"402":{"description":"Payment required, including when url is missing; x402 v2 exact, Base mainnet USDC, $0.25, server-declared Bazaar discovery extension.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64 JSON offer including accepts, resource, and extensions.bazaar with info and JSON Schema."}}},"409":{"description":"The authorization was already reserved for another target or signed payload."},"410":{"description":"The settled report was removed. No second payment is taken."},"429":{"description":"Verification or scan capacity exceeded. No new settlement; retry the same authorization after Retry-After."},"502":{"description":"Payment settled but the scan failed. PAYMENT-RESPONSE and report_url are retained for the manual 14-day refund process; retries do not charge or scan again."},"503":{"description":"Mainnet unavailable or service operation unconfirmed. Retry the identical signed request, not a new authorization."}}}},"\/api\/v1\/agent\/payment":{"get":{"operationId":"getAgentPaymentCapabilities","summary":"Discover live agent payment availability without creating an order","security":[],"responses":{"200":{"description":"Current availability, environment, USDC network and asset, exact tier amounts, safe payment\/retry instructions and 14-day manual refund terms. No credentials or private report data.","content":{"application\/json":{"schema":{"type":"object","required":["available","environment","network","asset","tiers","refunds"],"properties":{"available":{"type":"boolean"},"environment":{"type":"string","enum":["disabled","testnet","mainnet"]},"network":{"type":"string","enum":["eip155:8453","eip155:84532"]},"asset":{"type":"string"},"tiers":{"type":"object"},"refunds":{"type":"object"}}}}}}}},"post":{"operationId":"purchaseAgentReport","summary":"Purchase an existing report tier with x402 v2 on Base","description":"First GET payment capabilities and require available=true and environment=mainnet for real purchases. Base mainnet USDC is settled through Coinbase CDP; Base Sepolia is for testing only. Requires the private scan bearer capability and matching scan_id in the body. No account required. The offer contains no private scan capability. Only spend within the payer's approved limit. Retry the identical authorization at resource.url; pending payments must not be replaced. Same $9\/$29\/$79 one-time prices and 14-day refund promise; verified crypto refunds are manually returned to the original payer.","security":[{"scanIdBearer":[]}],"parameters":[{"name":"order_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"PAYMENT-SIGNATURE","in":"header","schema":{"type":"string","maxLength":24000},"description":"Base64-encoded x402 v2 exact EIP-3009 payment payload."}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["scan_id","tier"],"properties":{"scan_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"tier":{"type":"string","enum":["fix","pro","due_diligence"]}}}}}},"responses":{"200":{"description":"Settled purchase and bounded receipt. PAYMENT-RESPONSE contains the base64 settlement."},"202":{"description":"Settlement pending. Retry the same order and authorization after Retry-After."},"400":{"description":"Invalid request."},"401":{"description":"A matching private scan bearer capability is required."},"402":{"description":"PAYMENT-REQUIRED contains the base64 x402 v2 exact offer for the selected existing tier."},"409":{"description":"Already paid, competing checkout, expired offer, or authorization bound elsewhere."},"503":{"description":"Checkout disabled or settlement outcome unknown. Never replace an ambiguous payment."}}}},"\/api\/v1\/agent\/receipts\/{id}":{"get":{"operationId":"getAgentPaymentReceipt","summary":"Get a bounded settled payment receipt","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Receipt links settlement to a neutral report reference, not private scan links or evidence."},"404":{"description":"No settled receipt."}}}},"\/api\/v1\/report-reference\/{id}":{"get":{"operationId":"getPaidReportReference","summary":"Resolve a payment's neutral report reference","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Report ID, status, purchased tier and creation time only; not a security attestation."},"404":{"description":"No paid reference."}}}},"\/api\/v1\/scan":{"post":{"operationId":"startAuthorizedScan","summary":"Start an authorized passive scan","description":"Explicit ownership or authorization confirmation is required. The scan uses the same public-target validation, DNS\/IP SSRF protections, per-IP and per-target limits, one-in-flight limit, and bounded request\/byte\/time budget as the web scanner. All sanitized findings are available free through paginated summaries.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["url","owner_confirmed"],"properties":{"url":{"type":"string","minLength":3,"maxLength":2048,"description":"Public website URL you own or are authorized to test."},"owner_confirmed":{"type":"boolean","const":true,"description":"Confirm ownership or explicit authorization before starting."}}}}}},"responses":{"202":{"description":"The scan was accepted and is running asynchronously. Keep scan_id private.","content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["scan_id"],"properties":{"scan_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"Private bearer token; do not put it in public logs or commits."}}}}}},"400":{"description":"Consent is missing or the request is invalid."},"403":{"description":"Browser origin is not allowed."},"429":{"description":"Per-IP, per-target, or in-flight scan limit reached. A Retry-After header is included."},"503":{"description":"The service is temporarily unavailable."}}}},"\/api\/v1\/scan\/{id}":{"get":{"operationId":"getAuthorizedScanSummary","summary":"Get the minimal scan summary","description":"Provide the same scan_id in the Authorization bearer header. Returns status, score, whole-report counts, one page of sanitized findings, pagination, coverage, report_url and unlock.url. Repeat this request with offset=pagination.next_offset until null to read every finding. Offset defaults to 0; offsets at or beyond total return an empty terminal page. For MCP explain_finding use pagination.offset plus the zero-based array position, not the page-local position alone. Those URLs contain the private report capability: never publish or log them. Raw target URLs, email, evidence, response bodies, fixes and signatures are omitted.","security":[{"scanIdBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"description":"Global finding offset, normally pagination.next_offset from the previous response."}],"responses":{"200":{"description":"Minimal scan status and summary.","content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["status","grade","score","builder","counts","findings","pagination","coverage","report_url","status_url","unlock","next_step"],"properties":{"report_url":{"type":"string","format":"uri","description":"Private capability link for the human report. Do not publish it."},"status_url":{"type":"string","format":"uri","description":"Absolute URL for polling this scan with the matching private bearer ID."},"unlock":{"type":"object","additionalProperties":false,"required":["url","due_diligence_usd"],"properties":{"url":{"type":"string","format":"uri"},"agent_checkout_url":{"type":"string","format":"uri","description":"GET payment capabilities first; POST an x402 v2 exact purchase only when available=true and environment=mainnet. Base USDC, same one-time tiers."},"fix_usd":{"type":"integer","const":9},"fix_guard_usd":{"type":"integer","const":29},"due_diligence_usd":{"type":"integer","const":79},"already_unlocked":{"type":"boolean"}}},"next_step":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","error"]},"grade":{"type":["string","null"]},"score":{"type":["integer","null"],"minimum":0,"maximum":100},"builder":{"type":"string"},"counts":{"type":"object","additionalProperties":false,"required":["critical","high","medium","low","info","inconclusive"],"properties":{"critical":{"type":"integer","minimum":0},"high":{"type":"integer","minimum":0},"medium":{"type":"integer","minimum":0},"low":{"type":"integer","minimum":0},"info":{"type":"integer","minimum":0},"inconclusive":{"type":"integer","minimum":0}}},"findings":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["check","severity","title","impact"],"properties":{"check":{"type":"string","maxLength":40},"severity":{"type":"string","maxLength":40},"title":{"type":"string","maxLength":180},"impact":{"type":"string","maxLength":500}}}},"pagination":{"type":"object","additionalProperties":false,"required":["offset","returned","total","has_more","next_offset"],"description":"Findings retain stored order. Global finding_index = offset + page array position. Follow next_offset until null; counts describe the whole report. Pages have at most 100 findings and may be shorter to stay within the 60 KiB JSON-string-encoded summary budget, including MCP coverage guidance. A running scan may change; restart pagination once done.","properties":{"offset":{"type":"integer","minimum":0},"returned":{"type":"integer","minimum":0,"maximum":100},"total":{"type":"integer","minimum":0},"has_more":{"type":"boolean"},"next_offset":{"type":["integer","null"],"minimum":0}}},"coverage":{"type":"array","maxItems":9,"items":{"type":"object","additionalProperties":false,"required":["check","state","reason"],"properties":{"check":{"type":"string","maxLength":40},"state":{"type":"string","enum":["tested","not_tested","inconclusive"]},"reason":{"type":"string","maxLength":240}}}}}}}}},"400":{"description":"Offset must be a non-negative safe integer, supplied at most once."},"401":{"description":"A matching private scan ID bearer token is required."},"404":{"description":"No scan exists for this ID."},"503":{"description":"Report storage is temporarily unavailable. Retry only the same report read with the same private scan ID and offset after Retry-After; do not start another scan or retry target requests. Responses are never cached.","headers":{"Retry-After":{"description":"Seconds to wait before retrying this read.","schema":{"type":"integer","const":5}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","retry_after_seconds"],"properties":{"error":{"type":"string","const":"report_temporarily_unavailable"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer","const":5}}}}}}}}},"\/api\/v1\/grade":{"get":{"operationId":"checkPublicDeploymentReceipt","summary":"Check an owner-published deployment receipt","description":"Read only. Checks existing public proof; it does not scan or contact the target. A pass requires an owner-verified, current receipt with a valid signature, grade B or better, score of at least 75, zero Critical, High, or inconclusive findings, and complete full-scan coverage.","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":2048,"format":"uri"},"description":"Public deployment URL whose published ProofForge receipt should be checked."}],"responses":{"200":{"description":"A recent, valid receipt meets the published deployment policy."},"400":{"description":"The URL is invalid or is not a public HTTP(S) URL."},"409":{"description":"No current receipt exists, or the receipt fails the policy."}}}},"\/api\/verify\/{reportId}":{"get":{"operationId":"getCurrentPublicReceipt","summary":"Fetch an owner-published signed receipt","description":"Returns a privacy-minimized receipt only when the owner has verified the host, explicitly published the proof, and it is the latest eligible signed full scan. No finding evidence, private links, email, or paid fixes are returned.","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Public report identifier shown on the verification page."}],"responses":{"200":{"description":"Current privacy-minimized signed receipt.","content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["valid","algorithm","payload","canonicalPayload","receiptSha256","signature","keyId"],"properties":{"valid":{"type":"boolean"},"algorithm":{"const":"Ed25519"},"payload":{"type":"object","description":"Public receipt fields, including subject, grade, score, counts, coverage states, report hash and owner verification date."},"canonicalPayload":{"type":"string","description":"Exact UTF-8 canonical JSON bytes used for the signature."},"receiptSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"signature":{"type":"string"},"keyId":{"type":"string"}}}}}},"404":{"description":"Receipt is unpublished, superseded, stale, incomplete, or invalid."}}}},"\/mcp":{"post":{"operationId":"streamableHttpMcp","summary":"Use the MCP tools","description":"Stateless Streamable HTTP JSON-RPC endpoint. Supports initialize, ping, tools\/list, and tools\/call for scan_url, get_report, get_paid_fixes, explain_finding, and check_deployment_receipt. Every scan requires explicit ownership or authorization consent. get_paid_fixes requires a completed report and a still-captured purchase; it returns only that report's purchased remediation and does not contact the target.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer"]},"method":{"type":"string"},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"JSON-RPC response using application\/json. When a report read is unavailable, result.isError is true and content text contains JSON with error=report_temporarily_unavailable, message, and retry_after_seconds=5. Retry only the same tool call with the same arguments after the Retry-After interval; do not start a scan or retry target requests. Paid remediation is denied unless the scan capability matches an active captured order. These responses include Cache-Control: no-store."},"202":{"description":"Notification accepted without a response body."},"400":{"description":"Malformed JSON-RPC request."},"403":{"description":"Browser origin is not allowed."}}}}},"components":{"securitySchemes":{"scanIdBearer":{"type":"http","scheme":"bearer","description":"Use the private scan_id returned by POST \/api\/v1\/scan. The GET route also requires the same value in its path and Authorization header."}}}}