|
| 1 | +# Security Policy |
| 2 | + |
| 3 | +## Supply Chain Security |
| 4 | + |
| 5 | +`@stackbilt/llm-providers` is designed with supply chain security as a first-class concern: |
| 6 | + |
| 7 | +- **Zero runtime dependencies.** This package has no `dependencies` in `package.json`. The published npm tarball contains only our compiled code and the Apache-2.0 license. No transitive dependency tree to audit, no hidden packages to compromise. |
| 8 | +- **npm provenance attestation.** Every published version includes a [provenance attestation](https://docs.npmjs.com/generating-provenance-statements) cryptographically linking the npm package to the exact GitHub commit and CI workflow that built it. Verify this on the npm registry page under "Provenance." |
| 9 | +- **CI-only publishing.** Releases are published exclusively through GitHub Actions with OIDC-based npm authentication. No human has `npm publish` credentials — the publish token is scoped to the CI workflow and cannot be used outside of it. |
| 10 | +- **Signed commits.** All maintainer commits to `main` are signed. |
| 11 | +- **Branch protection.** The `main` branch requires passing CI (typecheck + full test suite) before merge. |
| 12 | + |
| 13 | +## Supported Versions |
| 14 | + |
| 15 | +| Version | Supported | |
| 16 | +|---------|-----------| |
| 17 | +| 1.x | Yes | |
| 18 | +| < 1.0 | No | |
| 19 | + |
| 20 | +We support the latest major version with security patches. Older major versions receive critical security fixes for 6 months after the next major release. |
| 21 | + |
| 22 | +## Reporting a Vulnerability |
| 23 | + |
| 24 | +**Do not open a public GitHub issue for security vulnerabilities.** |
| 25 | + |
| 26 | +Email **security@stackbilt.dev** with: |
| 27 | + |
| 28 | +1. Description of the vulnerability |
| 29 | +2. Steps to reproduce |
| 30 | +3. Impact assessment (what can an attacker do?) |
| 31 | +4. Any suggested fix |
| 32 | + |
| 33 | +We will acknowledge receipt within 48 hours and provide an initial assessment within 5 business days. Critical vulnerabilities affecting user credentials or API keys will be patched within 24 hours of confirmation. |
| 34 | + |
| 35 | +## Security Design |
| 36 | + |
| 37 | +### What this package handles |
| 38 | + |
| 39 | +- **API key transport.** Keys are passed via constructor config and sent only to the configured provider endpoints over HTTPS. Keys are never logged, serialized to disk, or sent to any Stackbilt service. |
| 40 | +- **Circuit breakers.** Prevent cascading failures from propagating across providers. A failing provider is isolated, not retried indefinitely. |
| 41 | +- **Rate limiting.** Configurable per-provider rate limits prevent accidental quota exhaustion or abuse amplification. |
| 42 | +- **Cost controls.** CreditLedger tracks spend per provider with configurable monthly budgets and threshold alerts. |
| 43 | + |
| 44 | +### What this package does NOT do |
| 45 | + |
| 46 | +- Store or cache API keys beyond the in-memory provider instance. |
| 47 | +- Make network requests to any endpoint other than the configured LLM provider APIs. |
| 48 | +- Phone home, collect telemetry, or transmit usage data. |
| 49 | +- Execute arbitrary code from provider responses. |
| 50 | + |
| 51 | +### Recommendations for users |
| 52 | + |
| 53 | +- **Rotate API keys** if you suspect any compromise of your environment. |
| 54 | +- **Set budget limits** via CreditLedger to cap spend in case of unexpected usage spikes. |
| 55 | +- **Use environment variables** for API keys, never hardcode them in source. |
| 56 | +- **Pin versions** in production (`@stackbilt/llm-providers@1.0.0`, not `^1.0.0`) for maximum reproducibility. |
| 57 | +- **Verify provenance** on the npm registry page before adopting a new version. |
| 58 | + |
| 59 | +## Audit Trail |
| 60 | + |
| 61 | +This package undergoes the following automated checks on every commit: |
| 62 | + |
| 63 | +- TypeScript strict mode compilation |
| 64 | +- Full test suite (unit + integration) |
| 65 | +- `npm audit` for known vulnerabilities in dev dependencies |
| 66 | +- Provenance attestation on publish |
| 67 | + |
| 68 | +For questions about our security practices, email security@stackbilt.dev. |
0 commit comments