Repository navigation
Commit 33b123e
committed
fix(policy_engine): propagate post_call pipeline metadata writes to request data
execute_steps hands the step hook a shallow copy of the request metadata so
the pipeline's guardrail marker cannot poison the caller. On the post_call
allow path _handle_pipeline_result then dropped that working copy entirely,
so a hook's standard_logging_guardrail_information and applied_guardrails
writes never reached the outer request. Deferred async logging built the
StandardLoggingPayload from the untouched original, so spend logs, Langfuse,
Datadog, and x-litellm-applied-guardrails all looked as if the scanner
never ran.
Copy the metadata bucket back on the post_call path and restore the
should_run_guardrail marker to its pre-step value in the executor so the
internal marker still cannot leak.1 parent 5556972 commit 33b123e
3 files changed
Lines changed: 81 additions & 12 deletions
File tree
- litellm/proxy
- policy_engine
- tests/test_litellm/proxy/utils/proxy_logging
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
185 | 186 | | |
| 187 | + | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| |||
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1670 | 1670 | | |
1671 | 1671 | | |
1672 | 1672 | | |
1673 | | - | |
1674 | | - | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
1675 | 1680 | | |
1676 | 1681 | | |
1677 | 1682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
922 | 965 | | |
923 | 966 | | |
924 | 967 | | |
| |||
1139 | 1182 | | |
1140 | 1183 | | |
1141 | 1184 | | |
1142 | | - | |
1143 | | - | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
1144 | 1193 | | |
1145 | 1194 | | |
1146 | | - | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1147 | 1200 | | |
1148 | 1201 | | |
1149 | 1202 | | |
1150 | 1203 | | |
1151 | 1204 | | |
1152 | 1205 | | |
1153 | | - | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
1154 | 1211 | | |
1155 | 1212 | | |
1156 | 1213 | | |
| |||
0 commit comments