# WritersLogic SPDX License Policy Evaluator

> WritersLogic SPDX License Policy Evaluator is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Parses SPDX license expressions and evaluates each against a caller-defined policy (allow/deny lists, copyleft tier, OSI/FSF flags) to verdict dependency licenses as pass or fail.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/spdx-policy?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-spdx-license-policy-evaluator-a246b56e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_T3MUJjaM8IXZr3STA5W5f

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-spdx-license-policy-evaluator-a246b56e -d '<json body>'
```

Example prompt: Check these SPDX expressions — 'MIT', 'GPL-2.0-only', 'Apache-2.0 AND LGPL-2.1-or-later', and 'MIT OR (GPL-2.0-only WITH Classpath-exception-2.0)' — against a policy that allows only OSI-approved licenses, denies GPL-2.0-only, blocks any strong copyleft, and permits the Classpath-exception-2.0 exception.

## When to prefer this

Use this endpoint when an AI agent needs to programmatically vet software dependency licenses at scale — especially in CI/CD pipelines, package ingestion workflows, or policy enforcement gates — where SPDX expression parsing, copyleft tier classification, and allow/deny policy evaluation are all needed in a single call. Prefer it over manual license lookups when you need batch evaluation (up to 50 expressions), structured flag metadata from the SPDX License List, and machine-readable verdicts with OR-branch resolution. Do not use it for detecting licenses from raw source text or reading package manifests directly.

## Known failure modes

- Malformed SPDX expression causes a parse error for that entry
- Unknown LicenseRef not in allowLicenseRefs yields an 'unknown' verdict rather than a hard failure
- More than 50 expressions submitted triggers a validation error
- License ID not found in the pinned SPDX list may result in unknown flags
- Deprecated IDs with allowDeprecated=false cause a fail verdict
- Contradictory allow and deny list entries may produce unexpected verdicts

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

For each submitted SPDX expression, the endpoint returns the canonical parsed form of the expression, per-license metadata flags from the pinned SPDX License List (OSI approved, FSF libre, deprecated), the policy verdict (pass/fail/unknown), and — for OR expressions — which branch of licenses satisfies the policy. Copyleft tier is provided as an id-family heuristic label.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "deny": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 100
   },
   "maxItems": 200,
   "description": "SPDX ids that always fail."
  },
  "allow": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 100
   },
   "maxItems": 200,
   "description": "If non-empty, only these SPDX ids pass (GPL-2.0-only and GPL-2.0 are the same entry; GPL-2.0+ means or-later and must be listed as such)."
  },
  "expressions": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 500
   },
   "maxItems": 50,
   "minItems": 1,
   "description": "SPDX expressions, e.g. 'MIT OR (GPL-2.0-only WITH Classpath-exception-2.0)'."
  },
  "denyCopyleft": {
   "enum": [
    "none",
    "strong",
    "any"
   ],
   "type": "string",
   "description": "Id-family heuristic: strong = GPL/AGPL/SSPL/EUPL/OSL/CC-BY-SA; any adds LGPL/MPL/EPL/CDDL and similar."
  },
  "allowDeprecated": {
   "type": "boolean",
   "description": "Default true: deprecated ids only add a witness. false: they fail."
  },
  "allowExceptions": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 100
   },
   "maxItems": 100,
   "description": "If non-empty, only these WITH exception ids pass."
  },
  "requireFsfLibre": {
   "type": "boolean",
   "description": "Fail licenses without isFsfLibre in the SPDX list."
  },
  "allowLicenseRefs": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 100
   },
   "maxItems": 100,
   "description": "LicenseRef-* ids the caller has reviewed; other refs yield unknown."
  },
  "requireOsiApproved": {
   "type": "boolean",
   "description": "Fail licenses without isOsiApproved in the SPDX list."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-spdx-license-policy-evaluator-a246b56e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
