Score field authorization coverage API

Count object and interface fields in the supplied subgraph SDL and mark a field when its line, or its type line, contains one of the supplied directive names. Coverage is the share of marked fields. This is a text count. It does not compose a supergraph or decide whether a request would be allowed.

The Score field authorization coverage operation is part of the Federation Authorization Audit API on BRAINIAC.software. Count object and interface fields in the supplied subgraph SDL and mark a field when its line, or its type line, contains one of the supplied directive names. Coverage is the share of marked fields. This is a text count. It does not compose a supergraph or decide whether a request would be allowed. It is exposed as POST /api/v1/graphql-security/field-authorization-coverage and priced at $0.04 USDC on Base. Payment uses the x402 exact scheme: an unpaid call returns HTTP 402 with payment requirements; after paying the exact USDC amount, retry the same request with a payment-signature header and Idempotency-Key. No account and no API key are required. Data sources for this product: Caller-supplied GraphQL subgraph SDL processed locally Caller-supplied GraphQL Federation deployment configuration processed locally Limitations: Schemas are the SDL strings in the request. No gateway, router, or subgraph is contacted. A difference between directives is a schema-level inconsistency. It does not show that a request would be allowed or denied at runtime. Known authorization directives are @authenticated, @requiresScopes, and @policy. Another directive is used only when the request supplies its semantics. The supergraph SDL is compared as supplied text. Federation composition is not executed. Deployment exposure is read from explicit labels in the request. URLs are not resolved or probed. field-authorization-coverage counts fields whose line contains a supplied directive. It does not decide whether a request would be allowed. subgraph-complexity walks type references in the supplied SDL. The index is that depth, and introspection adds risk only when the request says it is enabled. Outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Related operations in this group include Audit federation authorization, Audit federation subgraph exposure, Score subgraph query depth. Open the group documentation for the full request schema, field notes, and response examples before integrating.

POST$0.04 USDC
/api/v1/graphql-security/field-authorization-coverage

Example request

curl -i -X POST "https://www.brainiac.software/api/v1/graphql-security/field-authorization-coverage" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "protected_directives": [
    "@authenticated"
  ],
  "subgraphs": [
    {
      "name": "accounts",
      "sdl": "type User @key(fields: \"id\") {\n  id: ID!\n  email: String @authenticated\n  ssn: String\n}"
    },
    {
      "name": "reviews",
      "sdl": "type Review {\n  id: ID! @authenticated\n  body: String @authenticated\n}"
    }
  ]
}
JSON

An unpaid probe returns HTTP 402 with x402 payment requirements. After paying the exact USDC amount on Base, retry the identical request with a payment-signature header.

FAQ

  • Do I need an API key? No. Pay the listed USDC amount with x402.
  • What network? Base (eip155:8453), USDC.
  • Is this an official determination? No. Results are for human review against the cited sources.

Related APIs

Federation Authorization Audit APIFull docsHow it works