Phase 2: Create AI::Setting per group to opt-out of Anthropic Prompt Caching
# Allow Group-Level Opt-Out of Anthropic Prompt Caching
## Overview
This epic implements functionality allowing GitLab group administrators to opt out of Anthropic prompt caching at the group level, providing more granular control over AI-related data handling.
## Proposed Solution
Implement a group-level setting that allows group administrators to disable Anthropic prompt caching for their specific group. This setting will override the instance-level configuration for that group only.
## Requirements
- Add a new toggle in the group settings UI under AI/ML settings
- Implement backend logic to respect group-level opt-out preference
- Ensure the setting properly cascades to all projects within the group
- Add appropriate API endpoints for managing this setting
- Update relevant documentation
- Add audit logging for setting changes
## Technical Considerations
- Database schema updates needed for storing group preferences
- Cache invalidation strategy for existing prompts when setting is toggled
- Performance impact assessment for checking group-level settings
- Security reviews for permission models
## Success Criteria
- Group administrators can successfully opt out of prompt caching
- Setting correctly applies to all projects within the group
- No impact on other groups' settings
- Proper audit trail of setting changes
- Documentation updated to reflect new functionality
## Diagram
```mermaid
sequenceDiagram
actor GA as Group Admin
participant UI as GitLab UI
participant BE as Backend API
participant DB as Database
participant AI Gateway
GA->>UI: Navigate to Group Settings
UI->>BE: GET /groups/:id/settings
BE->>DB: Fetch current group settings
DB-->>BE: Return settings
BE-->>UI: Display settings page
GA->>UI: Toggle AI Prompt Cache
UI->>BE: PATCH /groups/:id/settings/ai
BE->>BE: Validate permissions
BE->>DB: Update group settings
BE->> AI Gateway : Send payload excluding/include caching
AI Gateway -->>BE: Confirmation
DB-->>BE: Update successful
BE-->>UI: Success response
UI-->>GA: Show success notification
```
epic