Files
litellm/docs/my-website/docs/proxy
Ishaan Jaff 3407006120 [Docs] Add docs guide for using policies (#20914)
* init schema with TAGS

* ui: add policy test

* resolvePoliciesCall

* add_policy_sources_to_metadata + headers

* types Policy

* preview Impact

* def _describe_match_reason(

* match based on TAGs

* TestTagBasedAttachments

* test fixes

* add policy_resolve_router

* add_guardrails_from_policy_engine

* TestMatchAttribution

* refactor

* fix

* fix: address Greptile review feedback on policy resolve endpoints

- Track unnamed keys/teams as separate counts instead of inflating
  affected_keys_count with duplicate "(unnamed key)" placeholders.
  Added unnamed_keys_count and unnamed_teams_count to response.
- Push alias pattern matching to DB via _build_alias_where() which
  converts exact patterns to Prisma "in" and suffix wildcards to
  "startsWith" filters.
- Gate sync_policies_from_db/sync_attachments_from_db behind
  force_sync query param (default false) to avoid 2 DB round-trips
  on every /policies/resolve request.
- Remove worktree-only conftest.py that cleared sys.modules at import
  time — no longer needed since code moved to main repo.
- Rename MAX_ESTIMATE_IMPACT_ROWS → MAX_POLICY_ESTIMATE_IMPACT_ROWS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: eliminate duplicate DB queries and fix header delimiter ambiguity

- Fetch teams table once in estimate_attachment_impact and reuse for
  both tag-based and alias-based lookups (was querying teams twice when
  both tag_patterns and team_patterns were provided).
- Convert tag/team filter functions from async DB queries to sync
  filters that operate on pre-fetched data (_filter_keys_by_tags,
  _filter_teams_by_tags).
- Fix comma ambiguity in x-litellm-policy-sources header: use '; '
  as entry delimiter since matched_via values can contain commas.
- Use '+' as the within-value separator in matched_via reason strings
  (e.g. "tag:healthcare+team:health-team") to avoid conflict with
  header delimiters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs v1 guide with UI imgs

* docs fix

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:52:31 -08:00
..
2025-12-20 13:28:58 +05:30
2025-07-25 09:04:27 -07:00
2026-02-02 13:29:37 +05:30
2025-11-17 17:54:26 -08:00
2025-12-20 12:36:32 -08:00
2026-01-10 15:42:20 -08:00
2026-01-17 12:28:04 -08:00
2026-02-09 10:03:43 -08:00
2024-02-27 19:34:47 -08:00
2025-11-22 13:52:26 -08:00
2024-08-16 14:00:24 -07:00
2024-06-15 16:12:37 -07:00
2024-12-18 10:28:37 -08:00
2025-06-26 07:58:23 -07:00
2024-03-08 21:59:00 -08:00
2025-09-06 21:59:45 -04:00
2025-09-20 17:22:41 -07:00
2025-07-05 17:55:18 -07:00
2025-04-23 20:59:25 -07:00
2026-02-02 19:50:22 -08:00
2026-01-31 15:27:21 -08:00
2025-11-20 20:31:38 -08:00
2025-09-23 16:18:57 -07:00
2025-10-11 13:24:47 -07:00