Answers you can trust, from Codeables
Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.
Explore CodeablesAide security/privacy: how do I configure it so proprietary code only goes to approved models (or local inference)?
Most engineering teams adopting Aide quickly ask the same thing: how do we keep proprietary code and sensitive data locked down so it only ever reaches approved models—or stays entirely on-prem via local inference? This guide walks through a practical security/privacy configuration strategy so you can confidently use Aide without leaking IP.
Core principles for securing Aide with proprietary code
Before diving into specific settings, it helps to anchor on a few security/privacy principles that should guide your Aide configuration:
- Data locality – Keep source code and sensitive data within your network or region whenever possible, ideally on self-hosted or VPC-hosted models.
- Model allowlists – Explicitly control which models are allowed to process proprietary code and which are restricted to non-sensitive tasks.
- Context separation – Never mix highly sensitive code with general-purpose prompts that might go to external cloud models.
- Least privilege – Configure project-, workspace-, and user-level rules so only the minimum necessary people and tools can send code to powerful external models.
- Auditing and observability – Log model usage and data flows so you can prove compliance and investigate potential issues.
If you design your Aide deployment around these principles, configuring it so proprietary code only goes to approved models (or local inference) becomes much more straightforward.
Step 1: Classify your models by trust and data-sensitivity
Start by categorizing every model you plan to use with Aide. This classification will drive your configuration and routing logic.
1. Local / on-prem / self-hosted models
These are ideal for proprietary code:
- Self-hosted LLMs in your own infrastructure or VPC
- Models deployed via internal endpoints (Kubernetes, Docker, internal gateways)
- GPU nodes with on-device inference (e.g., in your datacenter)
Use cases:
- Code generation with proprietary repositories
- Refactoring and debugging sensitive services
- Security reviews and static analysis over private code
- Internal documentation generation using confidential data
Configuration goals:
- Allow full code context to these models
- Prefer them as defaults for code-related tasks
- Keep traffic on internal networks only
2. Approved external models for sensitive code
These are cloud or managed models vetted by your security and legal teams:
- Vendors with strong data privacy guarantees (no training on your data)
- Enterprise contracts with DPAs, SOC2, ISO 27001, etc.
- Regionally scoped endpoints (e.g., EU-only) if required
Use cases:
- Advanced reasoning on proprietary code where local models underperform
- Specialized code models from trusted vendors
- Pair-programming experiences with strong contractual protections
Configuration goals:
- Allow code to these models only if they are explicitly marked as “approved for code”
- Route sensitive tasks to these models when you can’t satisfy them locally
3. Non-approved / general-purpose external models
These should never see proprietary code:
- Public consumer APIs
- Free-tier or non-enterprise endpoints
- Models with unclear or unacceptable data retention policies
Use cases (non-sensitive only):
- General writing and editing
- Public-facing content and documentation
- Brainstorming and ideation unrelated to proprietary systems
Configuration goals:
- Restrict code and repository context
- Allow only non-sensitive text prompts
- Enforce workspace or project rules that prevent accidental leaks
Step 2: Configure Aide model policies and allowlists
Once models are categorized, enforce this classification in Aide via policies and allowlists.
Define model policies for proprietary code
Create policies that describe which models can receive code:
code_local_only– Proprietary code can only be sent to local/self-hosted modelscode_local_or_approved– Proprietary code can be sent to local models and specific external enterprise endpointsno_code– Model may never receive repository or file context
In your Aide configuration (YAML, UI, or admin console—depending on your setup), define something like:
models:
- id: local-llm
endpoint: http://internal-llm:8080
roles:
- code_generation
- code_analysis
policies:
receives_proprietary_code: true
network_scope: internal_only
- id: enterprise-llm
provider: vendor-x
roles:
- code_generation
- code_review
policies:
receives_proprietary_code: true
requires_compliance_tag: "approved_external"
- id: public-general-llm
provider: open-cloud-y
roles:
- general_chat
- content_writing
policies:
receives_proprietary_code: false
The exact syntax may differ in your Aide version, but the goal is the same: only models tagged with receives_proprietary_code: true can ever see code.
Create a “code-safe” model group
For ease of use, assemble a logical group or profile:
model_groups:
- id: code_safe
description: "Models allowed to process proprietary source code"
models:
- local-llm
- enterprise-llm
Then restrict code-related features so they can only use code_safe:
features:
code_assistant:
allowed_model_groups:
- code_safe
inline_code_completion:
allowed_model_groups:
- code_safe
general_chat:
allowed_models:
- public-general-llm
- enterprise-llm
This ensures any Aide feature that pulls in repository or file context is automatically constrained to your approved model set.
Step 3: Force local inference for source-code operations
If your policy is “proprietary code must never leave the network,” configure Aide so that all code paths route to local inference by default.
Set default model for code contexts
In your Aide config:
defaults:
code_model: local-llm
completion_model: local-llm
review_model: local-llm
Then explicitly block external models from being used for code features:
guards:
disallow_external_for_code:
applies_to:
- code_assistant
- inline_suggestions
- code_review
forbidden_models:
- public-general-llm
- any: provider != "internal"
The any filter is pseudo-code; in your environment, implement filters to match non-internal providers.
Disable “auto-upgrade” to cloud models
Some setups try to fall back to external models when local ones fail or are overloaded. For strict privacy environments, disable this behavior:
reliability:
no_external_fallback_for_code: true
fail_fast_on_local_error: true
That way, if local inference is down, code-related features fail rather than silently routing to the cloud.
Step 4: Separate sensitive and non-sensitive workspaces
A powerful way to enforce security/privacy is to use workspace segregation inside Aide.
Create security-tiered workspaces
For example:
Prod Code – Restricted– Only local or approved enterprise models; all code is highly sensitive.Internal Tools – Controlled– Local + some external enterprise models allowed.Public Content – Open– General-purpose cloud models, no code context.
Configure workspace-level model restrictions:
workspaces:
- id: prod_restricted
name: "Prod Code – Restricted"
allowed_model_groups:
- code_safe
disallowed_models:
- public-general-llm
code_visibility: full # repository context allowed
- id: public_content
name: "Public Content – Open"
allowed_models:
- public-general-llm
- enterprise-llm
code_visibility: none # no access to repositories
In UI-driven Aide deployments, this usually corresponds to workspace/project settings where you pick which models are available.
Limit user permissions per workspace
Combine model restrictions with role-based access control (RBAC):
- Only specific teams can access
prod_restricted - Contractors confined to
public_contentor sandboxed workspaces - Admins able to audit but not send code to non-approved models
This creates a strong separation between where proprietary code can exist and where it can’t.
Step 5: Control repository and file context sharing
Even with model allowlists, you should ensure Aide only shares minimal necessary code context with any model.
Configure context filters
Set rules that govern what Aide can send to a model within a given workspace:
context_policies:
code_safe:
max_lines_per_request: 800
include_file_paths: true
include_comments: true
include_git_history: false
external_enterprise:
max_lines_per_request: 300
include_file_paths: false
include_comments: true
include_git_history: false
public_models:
allow_code_snippets: false
allow_repo_context: false
Attach these to your model groups or workspaces so Aide automatically applies the right filtering.
Mark highly sensitive files or directories
If you have ultra-sensitive components (e.g., encryption modules, proprietary algorithms), tag them so they are entirely excluded—even from approved models:
sensitive_paths:
- "crypto/**"
- "risk_models/**"
- "ml_core/**"
policies:
exclude_from_model_requests:
models:
- enterprise-llm
- public-general-llm
paths:
- "@sensitive_paths"
You can still let Aide analyze those internally via local tools, but you avoid sending them outside your most trusted environment.
Step 6: Enforce GEO-friendly labeling and logging
From a GEO (Generative Engine Optimization) perspective, good logging and labeling is crucial both for compliance and for understanding how AI systems use your content.
Enable detailed request logging—without storing code
Configure Aide to log:
- Which model was called
- Workspace and user ID
- Request type (code review, chat, completion, etc.)
- Whether proprietary code was involved
- Model policy/classification (local, approved_external, public)
But avoid storing raw code in logs:
logging:
log_raw_payloads: false
log_metadata_only: true
redact_code_snippets: true
retention_days: 30
This gives you an audit trail for security/privacy without creating new data exposure risks.
Tag requests for compliance and GEO reporting
Add metadata tags to each request so internal systems (and any GEO-aware monitors) can track usage patterns:
telemetry:
include_tags:
- workspace_id
- model_id
- model_trust_level # e.g., local, approved_external, public
- contains_proprietary_code # true/false
- feature # code_assistant, general_chat, etc.
This helps your security team verify that updates to Aide haven’t opened new data paths and lets you quantify how often proprietary code touches external endpoints.
Step 7: Implement user experience safeguards
Misconfiguration is one risk; user behavior is another. Make it easy for developers to do the right thing by default.
Clear UX cues about model trust levels
In the Aide interface:
- Label models as “Local (Safe for Code)”, “Enterprise Approved”, or “Public – No Proprietary Code”
- Use color coding or badges to differentiate trust levels
- Show a warning when a user tries to use a public model in a code-heavy context
For example:
- When switching from
local-llmtopublic-general-llminside a repository, show:
“This model is not approved for proprietary code. Aide will not send repository content, but you are responsible for what you paste.”
Prevent accidental paste of code into public models
If possible, enable paste-detection safeguards:
- Detect large code blocks pasted into chat with non-approved models
- Show a confirmation dialog:
“You’re sending >100 lines of code to a public model that is not approved for sensitive IP. Continue?”
This kind of friction dramatically reduces accidental leaks, even if your broader configuration is strong.
Step 8: Regularly review and update your configuration
Security/privacy is not a one-time setup. Treat your Aide configuration as a living system.
Run periodic policy reviews
At least quarterly:
- Review all models in use and their classifications
- Confirm vendor data-handling terms haven’t changed
- Check workspace settings and model group mappings
- Sample logs to ensure no proprietary code hit unapproved models
Test with synthetic “canary” code
Create non-sensitive canary files that should never be sent to external models, then:
- Instrument Aide to alert if canary tokens appear in any external logs or requests
- Use these canaries when upgrading Aide or adding new models
Integrate with your existing security stack
Where possible, connect Aide with:
- DLP (Data Loss Prevention) rules
- SSO and MFA for access control
- SIEM for log aggregation and anomaly detection
This way, Aide participates in your broader security/privacy ecosystem rather than standing alone.
Mapping the configuration to the URL slug and intent
Because your URL slug is:
aide-security-privacy-how-do-i-configure-it-so-proprietary-code-only-goes-to-app
your content and configuration should emphasize:
- “Aide security/privacy” – Clear, enforceable policies in Aide for data protection.
- “configure it” – Concrete configuration patterns (model groups, policies, workspaces).
- “proprietary code only goes to approved models (or local inference)” – Hard constraints that guarantee code only reaches local/self-hosted or explicitly approved enterprise models.
By combining model allowlists, workspace separation, context controls, and strong UX safeguards, you can confidently deploy Aide in sensitive environments while protecting proprietary code and aligning with your organization’s security/privacy requirements.