Stop AI from judging user habit content#4
Merged
Conversation
Remove overly restrictive scope boundaries and add explicit content policy so the AI processes any habit/task request without moralizing. Only refuse requests describing serious real-world harm to others. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon
added a commit
that referenced
this pull request
Apr 5, 2026
StringComparison.OrdinalIgnoreCase in LINQ cannot be translated to SQL by EF Core/Npgsql, causing query_habits to throw on every call. Replaced with ToLower().Contains() which translates to LOWER() in SQL. Also updated AI prompt rule #4 so the AI immediately searches for existing habits instead of asking the user for permission to check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
thomasluizon
added a commit
that referenced
this pull request
Apr 15, 2026
…page size
Adds two new DistributedRateLimitService policies:
- bulk (10 req/min): gates /api/habits/bulk, bulk/log, bulk/skip, DELETE /api/habits/bulk
so a script can't push thousands of rows in a burst.
- agent-execute (20 req/min): gates /api/ai/pending-operations/{id}/execute on top
of the step-up enforcement already in AgentPolicyEvaluator, so even with a
valid confirmation token the destructive path is throttled.
Also clamps GET /api/habits pageSize to [1, 200] so a crafted ?pageSize=100000
can't force a multi-second scan.
Covers backend plan F5 (P0 #4) and P1 input validation for PageSize.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon
added a commit
that referenced
this pull request
Apr 15, 2026
…page size
Adds two new DistributedRateLimitService policies:
- bulk (10 req/min): gates /api/habits/bulk, bulk/log, bulk/skip, DELETE /api/habits/bulk
so a script can't push thousands of rows in a burst.
- agent-execute (20 req/min): gates /api/ai/pending-operations/{id}/execute on top
of the step-up enforcement already in AgentPolicyEvaluator, so even with a
valid confirmation token the destructive path is throttled.
Also clamps GET /api/habits pageSize to [1, 200] so a crafted ?pageSize=100000
can't force a multi-second scan.
Covers backend plan F5 (P0 #4) and P1 input validation for PageSize.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
10 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Test plan
🤖 Generated with Claude Code