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
Adds an implementation plan for letting users express approval policies in natural language, with a two-tier evaluation architecture:
Compile when possible: If the policy is expressible as a Detent JSON Schema rule (e.g. "only allow read operations on Slack"), compile it to permissions.json for fast, deterministic, auditable enforcement.
Judge model when not: If the policy requires judgment or runtime state (e.g. "don't post anything rude", "no more than 5 calls per minute"), store a refined version and evaluate at runtime via a small model using Simon Willison's llm CLI.
Series composition: Detent runs first (fast deny), then the judge model provides additional restriction on requests Detent allows.
What's in this PR
plans/llm-based-evaluation.md — the full design document covering architecture, file layout, key design decisions, CLI commands, runtime flow, and implementation order.
No code changes.
Next steps
Review the plan for feedback on approach, scope, and priorities
@DanverImbue Thanks for the suggestion! I can definitely see use cases for this.
There are actually many scenarios that aren't covered by Detent's current functionality. This is true even for "structural policies" - for example, GraphQL APIs. Another feature that several people requested was client-side rate-limiting.
For this reason, I'm in the process of adding a generic hooks field to Detent's permission format. The idea is that Detent's core will remain JSON Schema based but on top of that, it will also be possible to define arbitrary hooks to run for each request. I believe that all the mentioned additional functionalities, including natural language policy evaluation, can be expressed in that way.
Would that work for you? I think I'll be done with it early next week so maybe we can revisit this once done?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an implementation plan for letting users express approval policies in natural language, with a two-tier evaluation architecture:
permissions.jsonfor fast, deterministic, auditable enforcement.llmCLI.What's in this PR
plans/llm-based-evaluation.md— the full design document covering architecture, file layout, key design decisions, CLI commands, runtime flow, and implementation order.No code changes.
Next steps
🤖 Generated with Claude Code