{"_id":"@authensor/connector-anthropic","name":"@authensor/connector-anthropic","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@authensor/connector-anthropic","version":"0.1.0","description":"Authensor safety connector for the Anthropic API — policy evaluation and content scanning on every call","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"dependencies":{"@authensor/engine":"0.1.0"},"optionalDependencies":{"@authensor/aegis":"0.1.0"},"peerDependencies":{"@anthropic-ai/sdk":">=0.30.0"},"peerDependenciesMeta":{"@anthropic-ai/sdk":{"optional":false}},"devDependencies":{"@anthropic-ai/sdk":"^0.39.0","@types/node":"^20.10.0","typescript":"^5.3.0"},"keywords":["authensor","anthropic","claude","connector","ai-safety","guardrails","policy-engine"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/authensor/authensor.git","directory":"packages/connector-anthropic"},"homepage":"https://github.com/authensor/authensor","publishConfig":{"access":"public"},"scripts":{"build":"tsc","dev":"tsc --watch","typecheck":"tsc --noEmit","clean":"rm -rf dist"},"_id":"@authensor/connector-anthropic@0.1.0","bugs":{"url":"https://github.com/authensor/authensor/issues"},"_integrity":"sha512-Bi53GEnFT+d24MXdrR+EtFiZvW0LJ8O72GStYOnwvm3UJV1qIQrk1P1+BON4uC/xBo4klMr8dRujT36GJTYnsQ==","_resolved":"/private/var/folders/_h/xdjfwx_n3qxc_plpqltl399m0000gn/T/7d87b101ffdd41c6fa0b0e54a93fe2d1/authensor-connector-anthropic-0.1.0.tgz","_from":"file:authensor-connector-anthropic-0.1.0.tgz","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Bi53GEnFT+d24MXdrR+EtFiZvW0LJ8O72GStYOnwvm3UJV1qIQrk1P1+BON4uC/xBo4klMr8dRujT36GJTYnsQ==","shasum":"568450117b3353c82db5858d51b4712440de43ea","tarball":"https://registry.npmjs.org/@authensor/connector-anthropic/-/connector-anthropic-0.1.0.tgz","fileCount":15,"unpackedSize":34930,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCCQTY8KZEGVwcZpwrf3Gq1FWAFiWu5c4YdvfmgY2aWIQIgSolWfZrHF1QBMAFIL8UwbHFeYwC95XrTbgjMi+Tbfls="}]},"_npmUser":{"name":"jkearn","email":"john@authensor.com"},"directories":{},"maintainers":[{"name":"jkearn","email":"john@authensor.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/connector-anthropic_0.1.0_1781250049676_0.7705445341185966"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-12T07:40:49.431Z","0.1.0":"2026-06-12T07:40:49.879Z","modified":"2026-06-12T07:40:50.132Z"},"maintainers":[{"name":"jkearn","email":"john@authensor.com"}],"description":"Authensor safety connector for the Anthropic API — policy evaluation and content scanning on every call","homepage":"https://github.com/authensor/authensor","keywords":["authensor","anthropic","claude","connector","ai-safety","guardrails","policy-engine"],"repository":{"type":"git","url":"git+https://github.com/authensor/authensor.git","directory":"packages/connector-anthropic"},"bugs":{"url":"https://github.com/authensor/authensor/issues"},"license":"MIT","readme":"# @authensor/connector-anthropic\n\nSafety connector for the Anthropic API. Wraps `@anthropic-ai/sdk` so every `messages.create()` call goes through Authensor policy evaluation and Aegis content scanning.\n\n## Quickstart\n\n```bash\nnpm install @authensor/connector-anthropic @anthropic-ai/sdk\n```\n\n```typescript\nimport { createSafeAnthropicClient } from '@authensor/connector-anthropic';\n\nconst client = await createSafeAnthropicClient({\n  apiKey: process.env.ANTHROPIC_API_KEY,\n  policy: {\n    id: 'my-policy',\n    name: 'My Policy',\n    version: '1.0.0',\n    rules: [\n      { id: 'allow-all', effect: 'allow' },\n    ],\n  },\n});\n\nconst response = await client.messages.create({\n  model: 'claude-sonnet-4-5-20250514',\n  max_tokens: 1024,\n  messages: [{ role: 'user', content: 'Hello' }],\n});\n```\n\n## What it does\n\n1. Before each `messages.create()` call, the request content is evaluated against your policy using the Authensor engine.\n2. If the policy says **deny**, an `AuthensorDeniedError` is thrown.\n3. If the policy says **escalate** (`require_approval`), an `AuthensorEscalationError` is thrown.\n4. If the policy says **allow**, the request is forwarded to the Anthropic API.\n5. After receiving a response, Aegis scans the output for threats (PII, injection, credentials, exfiltration).\n6. If Aegis flags the response, an `AuthensorContentThreatError` is thrown.\n\n## Configuration\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiKey` | `string` | env var | Anthropic API key |\n| `policy` | `Policy \\| string` | required | Authensor policy object or YAML string |\n| `principalId` | `string` | `'anthropic-connector'` | ID for audit trail |\n| `aegisEnabled` | `boolean` | `true` | Enable Aegis response scanning |\n| `onEvaluation` | `function` | - | Callback after policy evaluation |\n| `onAegisThreat` | `function` | - | Callback when Aegis flags content |\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-1c8fdcefb18f3959e349ff974f95e629"}