Provider‑agnostic structured outputs with fail‑closed guarantees.
prompt and schema to https://schemashield.ai/v1/shield.curl -X POST https://schemashield.ai/v1/shield \
-H "Authorization: Bearer ssk_..." \
-H "Content-Type: application/json" \
-d '{
"provider":"openai",
"model":"gpt-4.1-mini",
"prompt":"Extract a product {name, priceUSD:number}. Text: iPhone 15 costs $799.",
"schema":{"type":"object","properties":{"name":{"type":"string"},"priceUSD":{"type":"number"}},"required":["name","priceUSD"],"additionalProperties":false}
}'
Success: { ok:true, data }. Failure: { ok:false, error, diff } (non‑200).
# .github/workflows/shield.yml
name: SchemaShield CI
on: [pull_request]
jobs:
shield:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: schemashield/schemashield-action@v1
with:
token: ${{ secrets.SS_TOKEN }}
provider: openai
model: gpt-4.1-mini
schemas: ./schemas
prompts: ./prompts
seeds: 3
mode: validate
The action computes cases by matching prompt files to schema files by base filename and calls /v1/ci/run. It fails the job if any case fails or diffs.
Body:
{
"provider": "openai|anthropic",
"model": "string",
"prompt": "string",
"schema": { /* JSON Schema */ },
"temperature": 0.0,
"max_retries": 1,
"seed": 0,
"persist": false,
"mode": "validate|repair",
"provider_secrets": { "openai": {"api_key": "..."} }
}
Headers returned: X-SS-Remaining-Validations, X-SS-Remaining-Repairs, X-SS-Latency-MS.
{
"provider_matrix": [{"provider":"openai","model":"gpt-4.1-mini"}],
"seeds": [0,1,2],
"cases": [{"name":"person","prompt":"...","schema":{...}}],
"mode": "validate"
}
Returns 200 on pass, 409 with diff on failures.
provider_secrets.Support: support@schemashield.ai