mcp/ppl: mcp_tool criterion should ignore non-tool call requests (#5695)

## Summary

## Related issues

Fix
https://linear.app/pomerium/issue/ENG-2543/mcp-tool-ignore-non-jsonrpc-calls

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
This commit is contained in:
Denis Mishin 2025-07-07 14:22:22 -07:00 committed by GitHub
parent ecc5ecf881
commit a577f53ff4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 5 deletions

View file

@ -68,4 +68,15 @@ allow:
require.Equal(t, A{true, A{ReasonMCPNotAToolCall}, M{}}, res["allow"])
require.Equal(t, A{false, A{}}, res["deny"])
})
t.Run("no method name should pass", func(t *testing.T) {
res, err := evaluate(t, `
allow:
and:
- mcp_tool:
is: list_tables
`, []*databroker.Record{}, Input{})
require.NoError(t, err)
require.Equal(t, A{true, A{ReasonMCPNotAToolCall}, M{}}, res["allow"])
require.Equal(t, A{false, A{}}, res["deny"])
})
}