mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-10 08:28:25 +00:00
* fix(security): hash the publicly known master key Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs: replace weak master key examples and regenerate artifacts Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: replace weak key fixtures with generated test keys Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci: generate master keys for proxy startup Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve lens dev key entropy Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: restore proxy key compatibility in scrub examples Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: scrub merged SSO fixture and refresh dashboard bundle Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ci): stabilize test keys and metadata collection Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * chore: drop the rebuilt dashboard bundle Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: mateo <mateo@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
40 lines
1.3 KiB
Markdown
40 lines
1.3 KiB
Markdown
# Test Key Patterns Standard
|
|
|
|
Standard patterns for test/mock keys and credentials in the LiteLLM codebase to avoid triggering secret detection.
|
|
|
|
## How GitGuardian Works
|
|
|
|
GitGuardian uses **machine learning and entropy analysis**, not just pattern matching:
|
|
- **Low entropy** values (like `sk-test`, `postgres`) are automatically ignored
|
|
- **High entropy** values (realistic-looking secrets) trigger detection
|
|
- **Context-aware** detection understands code syntax like `os.environ["KEY"]`
|
|
|
|
## Recommended Test Key Patterns
|
|
|
|
### Option 1: Low Entropy Values (Simplest)
|
|
These won't trigger GitGuardian's ML detector:
|
|
|
|
```python
|
|
api_key = "sk-test"
|
|
api_key = "sk-mock"
|
|
database_password = "postgres"
|
|
token = "test123"
|
|
```
|
|
|
|
### Option 2: High Entropy with Test Prefixes
|
|
If you need realistic-looking test keys with high entropy, use these prefixes:
|
|
|
|
```python
|
|
api_key = "sk-test-abc123def456ghi789..." # OpenAI-style test key
|
|
api_key = "sk-mock-1234567890abcdef1234..." # Mock key
|
|
api_key = "sk-fake-xyz789uvw456rst123..." # Fake key
|
|
token = "test-api-key-with-high-entropy"
|
|
```
|
|
|
|
## Configured Ignore Patterns
|
|
|
|
These patterns are in `.gitguardian.yaml` for high-entropy test keys:
|
|
- `sk-test-*` - OpenAI-style test keys
|
|
- `sk-mock-*` - Mock API keys
|
|
- `sk-fake-*` - Fake API keys
|
|
- `test-api-key` - Generic test tokens
|