You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
Request body inspection helpers for HTTP policy evaluation
NewHTTPCallWithBody(method, host, path, body) constructs a Call with the decoded request body exposed under params.body, so rules can match on body contents (e.g. params.body.model == 'gpt-4' or hasSecrets(params.body.prompt)). body is typed any, accepting a JSON object, array, or scalar. The existing NewHTTPCall is unchanged.
Engine.RequiresBody(scope) reports, from compile-time analysis of the scope's rules, whether any rule references params.body. Gatekeepers can use this as a trigger to decide whether to buffer and parse the request body before evaluating. It fails safe: every idiomatic body reference is detected, and an unrecognized use of the params map (or an unknown scope) returns true so the body is buffered rather than silently skipped.