Skip to content

Conversation

@valtzu
Copy link
Contributor

@valtzu valtzu commented Jul 12, 2025

Q A
Bug fix? no
New feature? yes
Docs? yes
Issues Fix php-llm/llm-chain#360
License MIT

Add #[IsGrantedTool] attribute for tool access control with similar behavior as #[IsGranted] in symfony/security-http.

Moved from php-llm/llm-chain#382

@valtzu valtzu requested review from Nyholm and chr-hertel as code owners July 12, 2025 11:18
@valtzu valtzu force-pushed the tools-security branch 2 times, most recently from 0fe967a to d1cb720 Compare July 12, 2025 11:29
Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing it to Symfony AI and switching to the bundle - I think it makes more sense 👍

Besides the pipeline, this needs a rebase after #94, and a brief section in the docs of the bundle - it's a powerful new feature users should know about :)

@chr-hertel chr-hertel added AI Bundle Issues & PRs about the AI integration bundle Feature New feature Status: Needs Work labels Jul 12, 2025
@valtzu valtzu force-pushed the tools-security branch 2 times, most recently from 27c3126 to 32f3222 Compare July 13, 2025 16:23
@valtzu
Copy link
Contributor Author

valtzu commented Jul 13, 2025

Rebased & added docs.

About PHPStan error, not sure what to do with it, it's about this 3rd parameter: https://github.com/symfony/symfony/blob/7.4/src/Symfony/Component/Security/Core/Authorization/AuthorizationCheckerInterface.php#L27

@chr-hertel
Copy link
Member

About PHPStan error, not sure what to do with it, it's about this 3rd parameter

my first thought here would be to ignore the error in the phpstan.dist.neon with some kind of comment that we can drop it one day - when dropping Symfony 7.4 support?

@valtzu valtzu force-pushed the tools-security branch 2 times, most recently from 469e22c to ec41a45 Compare July 14, 2025 11:34
@valtzu
Copy link
Contributor Author

valtzu commented Jul 14, 2025

Thanks, adjusted based on your feedback, pipe finally green 😌

Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work & great feature! 🙌

@chr-hertel
Copy link
Member

Thank you @valtzu.

@chr-hertel chr-hertel merged commit 1089e85 into symfony:main Jul 14, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Bundle Issues & PRs about the AI integration bundle Feature New feature Status: Needs Work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool access control

2 participants