-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add AI/LLM policy support ("a" type) with natural language evaluation #1695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
Co-authored-by: hsluoyz <[email protected]>
Co-authored-by: hsluoyz <[email protected]>
Co-authored-by: hsluoyz <[email protected]>
…ror logging Co-authored-by: hsluoyz <[email protected]>
|
@copilot fix failed CI check: https://github.com/casbin/casbin/actions/runs/21330100245?pr=1695 |
…o ai_api.go Co-authored-by: hsluoyz <[email protected]>
... Fixed both CI issues in commit e2bab52:
All tests pass successfully. |
Benchmark ComparisonComparing base branch ( 🤖 This comment will be automatically updated with the latest benchmark results. |
change "description" to "prompt" everywhere in the code |
Co-authored-by: hsluoyz <[email protected]>
|
... Changed "description" to "prompt" everywhere in commit 9b12cb4:
All tests pass successfully. |
Implementation Plan for AI/LLM Policy Support ("a" type)
Summary
Successfully implemented AI/LLM policy support ("a" type) in Casbin with comprehensive error handling and robust parsing.
Recent Changes:
a = promptinstead ofa = descriptionpolicyDescriptiontopolicyPromptCore Changes:
Files Modified/Created:
model/model.go- Added "a" section supportmodel/policy.go- Added ClearPolicy support for "a" policiesai_api.go- Added evaluateAIPolicy() with robust parsing, uses "prompt" terminologyai_policy_api.go- Complete management APIenforcer.go- Integrated AI policy evaluation with reduced complexity, uses "prompt" terminologyai_policy_api_test.go- Comprehensive test suiteexamples/ai_policy_model.conf- Uses "a = prompt" definitionTesting:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.