feat(aiguard): add optional user to resolve_and_execute_policy - #587
Merged
willguibr merged 1 commit intoSep 18, 2026
Merged
Conversation
Forward an optional end-user identity to the AI Guard DAS resolve-and-execute endpoint so the user is recorded on the detection event and surfaces on the dashboard. Adds a `user` param to PolicyDetectionAPI.resolve_and_execute_policy (sent as body["user"] when provided) and keeps DasResolveAndExecuteDetectionsPolicyRequest in sync. Optional/nullable, so existing callers are unaffected. Enables the TrueFoundry guardrail wrapper (ECS-4551) to attribute traffic to the end user; pairs with the platform DAS change (ECS-4552). ECS-4553
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 18, 2026
## [1.10.0](v1.9.44...v1.10.0) (2026-09-18) ### Features * **aiguard:** add optional user to resolve_and_execute_policy ([#587](#587)) ([aef6d24](aef6d24))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add an optional
userargument toPolicyDetectionAPI.resolve_and_execute_policy(...)so callers can forward the end-user identity to the AI Guard DAS resolve-and-execute endpoint. When provided it is sent asbody["user"];DasResolveAndExecuteDetectionsPolicyRequestis kept in sync.Why
The TrueFoundry guardrail wrapper needs to attribute traffic to the end user on the AI Guard dashboard. The wrapper pulls the user from TrueFoundry's
context.userand passes it here; the AI Guard DAS API records it on the detection event.Compatibility
Optional / nullable — existing callers are unaffected (no
usersent when omitted).Related