mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
- Add organizing rules (language/domain structure, naming, metadata) - Require all rules to fail CI (severity: ERROR, no warn-only) - Move unbounded-memory.yml to python/reliability/ per structure - Enhance unbounded-memory rule metadata (tags, confidence, source)
1,005 B
1,005 B
Custom Semgrep Rules
All .yml files under .semgrep/rules/ run in CI (CircleCI semgrep job).
Add a Rule
- Add a
.ymlfile under.semgrep/rules/<language>/<domain>/
Organizing Rules
Structure: language → domain
.semgrep/rules/<language>/<domain>/<rule-name>.yml
Examples:
python/security/unsafe-yaml-load.ymlpython/reliability/missing-timeout-http.ymlpython/performance/blocking-io-in-async.yml
Rule metadata
Match tags to the folder for consistent filtering:
metadata:
tags: [python, security]
Severity expectations
All rules must fail CI on findings. No warn-only rules.
- Use
severity: ERRORin rule metadata - If a rule is noisy → refine until low false positives before adding
Run Locally
semgrep scan --config .semgrep/rules . --error
With Semgrep registry:
semgrep scan --config auto --config .semgrep/rules .