LLM Model Access Control
LLM models without access control can cause data leaks, cost explosions, and compliance violations. Four controls: allowlisting, permissions, auditing and versioning.
What is LLM Model Access Control? Simply Explained
LLM model access control is like a gatekeeper for AI models: model allowlisting only allows vetted models and blocks deprecated or insecure models. Model permissions define granular access rights based on user tier, use case, and data sensitivity. Model access auditing logs all model access for compliance (SOC2/GDPR/ISO27001) and incident response. Model versioning tracks versions with deprecation policy and canary rollout for safe updates. Without access control, attackers can cause data leaks, trigger cost explosions, or conduct compliance violations.
↓ Jump to model access control controls
4 Model Access Control Controls
Maintain an allowlist of approved LLM models. Block access to unapproved or deprecated models to ensure only vetted models are used.
# Moltbot model allowlisting:
model_allowlist:
enabled: true
# Approved models:
approved_models:
- id: "gpt-4-turbo-preview"
provider: "openai"
version: "latest"
approved_for: ["production", "staging"]
approved_by: "security-team"
approved_date: "2025-01-01"
- id: "claude-3-opus"
provider: "anthropic"
version: "20240229"
approved_for: ["production"]
approved_by: "security-team"
approved_date: "2025-01-15"
# Blocked models:
blocked_models:
- id: "deprecated-model-v1"
reason: "Security vulnerability"
blocked_date: "2025-02-01"
# Enforcement:
enforcement:
action: block # Options: block, warn, allow_with_flag
block_message: "Model not approved. Use an approved model from the allowlist."Assign permissions to models based on user tier, use case, and data sensitivity. Restrict access to powerful models for sensitive use cases.
# Moltbot model permissions:
model_permissions:
enabled: true
# User tier-based permissions:
user_tier:
free:
allowed_models: ["gpt-3.5-turbo"]
max_tokens_per_request: 4000
pro:
allowed_models: ["gpt-3.5-turbo", "gpt-4-turbo-preview"]
max_tokens_per_request: 8000
enterprise:
allowed_models: ["gpt-3.5-turbo", "gpt-4-turbo-preview", "claude-3-opus"]
max_tokens_per_request: 32000
# Use case-based permissions:
use_case:
general_chat:
allowed_models: ["gpt-3.5-turbo"]
code_generation:
allowed_models: ["gpt-4-turbo-preview", "claude-3-opus"]
data_analysis:
allowed_models: ["gpt-4-turbo-preview", "claude-3-opus"]
# Data sensitivity-based permissions:
data_sensitivity:
public:
allowed_models: ["gpt-3.5-turbo", "gpt-4-turbo-preview", "claude-3-opus"]
internal:
allowed_models: ["gpt-4-turbo-preview", "claude-3-opus"]
confidential:
allowed_models: ["claude-3-opus"]Audit all model access events. Log which users accessed which models, when, and for what purpose. Enable compliance and incident response.
# Moltbot model access auditing:
model_access_audit:
enabled: true
# Audit logging:
logging:
log_all_access: true
log_fields:
- user_id
- model_id
- model_provider
- timestamp
- request_id
- use_case
- token_count
- cost
- data_sensitivity
# Audit storage:
storage:
type: "database" # Options: database, file, s3
retention_days: 365
encryption: true
# Audit alerts:
alerts:
enabled: true
# Alert on:
# - Access to blocked models
# - Unusual model access patterns
# - High-cost model usage
# - Access by unauthorised users
alert_on:
- blocked_model_access
- unusual_pattern
- high_cost_usage
- unauthorised_access
# Compliance reporting:
compliance:
enabled: true
# Generate compliance reports for:
# - SOC 2 (model access logs)
# - GDPR (data processing logs)
# - ISO 27001 (access control logs)
reports:
- soc2_model_access
- gdpr_data_processing
- iso27001_access_controlTrack model versions and enforce version policies. Prevent use of deprecated models and ensure smooth rollouts of new versions.
# Moltbot model versioning:
model_versioning:
enabled: true
# Version tracking:
tracking:
enabled: true
# Track: model ID, provider, version, release date, deprecation date
# Maintain version history for audit trails
# Deprecation policy:
deprecation:
enabled: true
# Deprecate models after:
deprecation_after_months: 12
# Notify users before deprecation:
notify_before_days: 30
# Block deprecated models:
block_deprecated: true
# Version rollout:
rollout:
strategy: "canary" # Options: canary, blue_green, big_bang
# Canary rollout: 10% -> 50% -> 100%
canary_stages:
- percentage: 10
duration_hours: 24
- percentage: 50
duration_hours: 48
- percentage: 100
duration_hours: 0
# Rollback:
rollback:
enabled: true
# Allow rollback to previous version on issues
rollback_window_hours: 72
# Automatic rollback on error rate threshold
auto_rollback_error_threshold_percent: 5Frequently Asked Questions
What is the difference between model allowlisting and model permissions?
Model allowlisting is a binary control — a model is either approved or not approved for use in your system. It's a gate that prevents unapproved models from being used at all. Model permissions are granular controls that define which users can use which models, for which use cases, and with what limits. Example: allowlisting says 'GPT-4 is approved for use'. Permissions say 'Enterprise users can use GPT-4 for code generation with 32K tokens, free users cannot use GPT-4 at all'. Both are necessary: allowlisting ensures only vetted models are used, permissions ensure appropriate use of those models.
How do I implement model access auditing for compliance?
Model access auditing for compliance requires: 1) Log all model access events with relevant fields (user_id, model_id, timestamp, use_case, token_count, cost). 2) Store logs securely with encryption at rest and in transit. 3) Retain logs for required period (SOC 2: 90 days minimum, GDPR: as long as needed, ISO 27001: 3 years). 4) Generate compliance reports on demand (SOC 2 reports, GDPR data processing records, ISO 27001 access control logs). 5) Enable audit alerts for suspicious activity (blocked model access, unusual patterns, high-cost usage). 6) Implement log integrity (hash logs, append-only storage) to prevent tampering.
How do I handle model deprecation and version rollouts?
Model deprecation and version rollout strategy: 1) Deprecation policy — deprecate models after a set period (e.g., 12 months) to encourage migration to newer models. 2) Notify users — notify users 30 days before deprecation with migration guidance. 3) Block deprecated models — automatically block access to deprecated models after deprecation date. 4) Version rollout — use canary rollout (10% -> 50% -> 100%) to test new versions before full rollout. 5) Rollback — maintain rollback window (72 hours) to revert to previous version if issues arise. 6) Monitor — monitor error rates and user feedback during rollout.
What are the security risks of uncontrolled model access?
Uncontrolled model access poses several security risks: 1) Data leakage — users may send sensitive data to models that don't meet security requirements (e.g., models that log data). 2) Cost explosion — users may access expensive models without limits, causing uncontrolled costs. 3) Compliance violations — using unapproved models may violate compliance requirements (SOC 2, GDPR, ISO 27001). 4) Deprecated model usage — using deprecated models with known vulnerabilities. 5) Model jailbreaks — powerful models may be more susceptible to jailbreaks, increasing risk. 6) Audit trail gaps — without access logging, you cannot track who used which models for what purpose.