spring-projects / spring-projects/spring-ai
Prevent tools from being added to prompt if current security context doesn't have authority.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Per #2356, I'm trying to prevent @Tool-annotated methods (or even Function beans from being invoked using Spring Security's @PreAuthorize annotation if the current security context doesn't have proper authority.
But what would be even better is if there were some pre-prompt filtering to prevent tools for which authority hasn't been granted from even making it into the prompt and therefore the LLM wouldn't even ask to invoke them.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review issue #2356 and the handling of @Tool-annotated methods and Function beans with Spring Security's @PreAuthorize. Determine where tools are assembled into the prompt and define how unauthorized tools should be excluded before prompting, then verify that authorized tools remain available and unauthorized ones are not offered for invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authorization, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100