{"_id":"@ariada-org/content-policy","name":"@ariada-org/content-policy","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ariada-org/content-policy","version":"0.1.0","description":"Composable content-policy gate — evaluate text against rule-pack profiles per publish surface, emitting a GateDecision verdict. Open source under EUPL-1.2.","license":"EUPL-1.2","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"bin":{"content-gate":"dist/cli.js"},"engines":{"node":">=22"},"repository":{"type":"git","url":"git+https://github.com/ariada-org/ariada.git","directory":"packages/ariada-content-policy"},"devDependencies":{"@types/node":"^22.10.2","rimraf":"^6.0.1","typescript":"^5.7.2","vitest":"^4.1.0"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run","clean":"rimraf dist coverage","lint":"eslint src test"},"_id":"@ariada-org/content-policy@0.1.0","bugs":{"url":"https://github.com/ariada-org/ariada/issues"},"homepage":"https://github.com/ariada-org/ariada#readme","_integrity":"sha512-aUQ9CH1ZoKkprMQsYgSxQTdhj0SldVbyxEg8thOstVS8ITEhnafyyHLpp+p75BHp+rIrfnAOp0I86LZHFgeRfg==","_resolved":"/private/var/folders/2c/_42xj0l179z8yc7wmp5k91s00000gn/T/42422d679c09c341dafc0588c435388c/ariada-org-content-policy-0.1.0.tgz","_from":"file:ariada-org-content-policy-0.1.0.tgz","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-aUQ9CH1ZoKkprMQsYgSxQTdhj0SldVbyxEg8thOstVS8ITEhnafyyHLpp+p75BHp+rIrfnAOp0I86LZHFgeRfg==","shasum":"ea9004dbb80d209a7dff4bb94a9ab166eba36d02","tarball":"https://registry.npmjs.org/@ariada-org/content-policy/-/content-policy-0.1.0.tgz","fileCount":39,"unpackedSize":119055,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHXigzT9Hl8Z+V41huTN94d4HQVUTY7a5dyXD5KXpDyXAiEAyojQc7xMQPGN0Fjdjt6GbFF+RyfAHGnx28zg3ws7maA="}]},"_npmUser":{"name":"agonist","email":"ab@agonist.ai"},"directories":{},"maintainers":[{"name":"agonist","email":"ab@agonist.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/content-policy_0.1.0_1784942562204_0.8672421740307632"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-25T01:22:42.057Z","0.1.0":"2026-07-25T01:22:42.357Z","modified":"2026-07-25T01:22:42.677Z"},"maintainers":[{"name":"agonist","email":"ab@agonist.ai"}],"description":"Composable content-policy gate — evaluate text against rule-pack profiles per publish surface, emitting a GateDecision verdict. Open source under EUPL-1.2.","homepage":"https://github.com/ariada-org/ariada#readme","repository":{"type":"git","url":"git+https://github.com/ariada-org/ariada.git","directory":"packages/ariada-content-policy"},"bugs":{"url":"https://github.com/ariada-org/ariada/issues"},"license":"EUPL-1.2","readme":"<!--\nSPDX-FileCopyrightText: 2026 Agonist Development AB\nSPDX-License-Identifier: EUPL-1.2\n-->\n\n# `@ariada-org/content-policy`\n\nComposable content-policy gate. Evaluates text against rule-pack profiles keyed\nper publish surface and emits a `GateDecision` verdict (`pass` / `warn` /\n`fail`) with per-finding fingerprints. Zero runtime dependencies, network-free,\nReDoS-safe patterns.\n\nLicense: EUPL-1.2 (European Union Public Licence v1.2).\n\n## Install\n\n```bash\nnpm install @ariada-org/content-policy\n```\n\nRequires Node 22 LTS or newer.\n\n## Usage\n\n```ts\nimport { evaluateContent, builtinPacks, ossSurfaceProfile } from '@ariada-org/content-policy';\n\n// A leaked credential is one of the things the oss-surface profile fails on.\nconst decision = evaluateContent('token=sk-EXAMPLEPLACEHOLDERKEY000000', ossSurfaceProfile, builtinPacks);\n\nif (decision.result === 'fail') {\n  for (const finding of decision.findings) {\n    console.error(`${finding.ruleId} @ line ${finding.line}: ${finding.matchedText}`);\n  }\n  process.exit(1);\n}\n```\n\n`evaluateContent` runs the deterministic regex tier only. For prompt (semantic)\nrules, call `evaluateContentAsync` with a `SemanticEvaluator`; without one,\nprompt rules are reported as `unevaluated` so a `pass` never overstates\ncoverage.\n\n## Two tiers\n\n- **Deterministic** — regex patterns compiled from each rule-pack, matched\n  line-by-line. Malformed patterns are caught at runtime so one broken rule can\n  never crash the gate; a build-time test asserts every shipped builtin pattern\n  compiles.\n- **Semantic** — prompt rules judged by an injected evaluator. A budget-aware\n  evaluator surfaces exhaustion in the decision's `unevaluated` field rather\n  than silently dropping content.\n\n## Documentation\n\nFull API and rule-pack reference: <https://github.com/ariada-org/ariada/tree/main/packages/ariada-content-policy>.\n","readmeFilename":"README.md","_rev":"1-96aba7642a39d5c9774daa140772d265"}