Skip to content

Security: boriskwemo/llm-ledger

Security

SECURITY.md

Security Policy

Security is a core design goal of LLM Ledger: your LLM API keys and usage data should never leak. This document explains how to report a vulnerability and how the project handles security.

Supported versions

Version Supported
Latest release (main branch) ✅
Older releases ❌

We backport critical fixes to the latest minor release only. Please upgrade to the newest version before reporting.

Reporting a vulnerability

If you believe you have found a security issue, please do not open a public issue.

Report it privately by emailing:

📧 security@boriskwemo.dev (placeholder - replace with your real contact)

Please include:

  1. A short description of the issue.
  2. Steps to reproduce (a minimal code snippet or config helps a lot).
  3. The affected version(s) and PHP version.
  4. The potential impact (e.g. API key exposure, SQL injection, SSRF).

What to expect

  • Acknowledgment within 48 hours.
  • A confirmed or declined assessment, usually within 7 days.
  • A fix + advisory coordinated with you. We will credit you unless you ask to remain anonymous.

Security best practices for API keys

LLM Ledger never persists, logs, or stores your API keys in the tracking database - keys live in memory only. To keep it that way:

  1. Use environment variables, not literals - prefer api_key: env(OPENAI_API_KEY) (YAML), %env(OPENAI_API_KEY)% (Symfony), or env() (Laravel).
  2. Never commit .env - it is already gitignored.
  3. Laravel: php artisan config:cache bakes env() values into bootstrap/cache/config.php. Exclude that cache from version control and rotate keys if it ever leaks.
  4. Rotate keys if a key is ever exposed, and use per-project or least-privilege keys where your provider supports them.
  5. Scope the tracking database - it stores prompts and completions (when tracking.store_content is enabled), which may contain sensitive user data. Apply the same access controls you would to any application log.

Security considerations in the codebase

  • HTTP layer: only Authorization, x-api-key, and x-goog-api-key headers carry secrets; responses are stored, never requests.
  • Storage: all queries use PDO prepared statements / Laravel's query builder (no string-interpolated SQL values).
  • SSRF: provider base_url values are configurable by design (to support self-hosted endpoints). Only configure trusted URLs.

Out of scope

  • Vulnerabilities in third-party dependencies should be reported to their maintainers (we track them via composer audit).
  • Issues that require an attacker to already have filesystem/config access to your application.

There aren't any published security advisories