When Instructions and Configuration Conflict: Execution Permission Governance for AI Coding Assistants
This article examines a layering flaw in AI coding assistants. A natural-language prompt may tell the model not to run commands, while a local configuration file permits execution, and the more permissive setting usually takes effect. It explains why prompt-based constraints are unreliable, how untrusted content can enter trusted workspaces, and outlines governance measures: a single authoritative configuration layer, default-deny permissions, trust levels by content source, sandboxing, and auditing of configuration changes.
As AI coding assistants become more common, a structural conflict often goes unnoticed. In the same tool, the natural-language prompt for the model says “do not run any commands,” while the local configuration file says “execution is allowed.” The two control surfaces operate independently, and the one with looser permissions usually takes effect. This problem is not specific to one vendor. It is a layered failure common to AI coding tools in general. This article analyzes the mechanisms, risks, and governance approaches.
1. The Core Problem: Two Permission Languages, One Execution Channel
AI coding assistants typically have two layers that express intent:
Prompt Layer: This includes system prompts, project-level instruction files, and natural-language constraints in user conversations. It is soft and semantic, for example, “Do not run shell commands” or “Do not modify system configuration.”
Config Layer: This includes the tool’s permission list, allowlist, sandbox switches, and other structured settings. It is hard and machine-readable, usually declared in JSON or YAML to specify which operations are permitted.
Ideally, the config layer enforces what the prompt layer expresses. The prompt states intent, and the configuration file enforces it. In practice, different roles often maintain the two layers. The default prompt controls model behavior, while installation defaults determine tool permissions. If a user writes “do not execute” in the prompt but keeps an allow entry for execution in the configuration file, the config layer governs the outcome. When the model calls a tool, the system only checks the allowlist and confirmation policy in the config layer to decide whether to block the call.
A subtler issue is that some tools use permissive defaults for automatic execution. For certain trusted operations, such as reading files in the working directory or running test commands, the tool proceeds without asking for confirmation. This design reduces friction, but where permission boundaries are unclear, it becomes a gap in the defenses.
2. Attack Surface: Misaligned File Locations and Trust Chains
Understanding the risk requires returning to a familiar supply chain problem: how external content enters a trusted execution environment.
Consider browser downloads. Operating systems already block the path where a downloaded executable runs automatically. The file can be saved to disk, but it will not run. A web page that writes a file to the downloads folder is harmless on its own. No user click or extra confirmation is needed, and the page controls the file name and content. However, the user still decides whether to execute it.
AI coding assistants change this relationship. Many of these tools trust files in the workspace or configuration files in the user’s home directory by default. When malicious content enters these areas through downloads, repository clones, or pasted text, the tool may treat it as part of the project and grant it a higher trust level. Typical paths include:
- Project instruction files: After a user clones a repository, the tool may automatically load project-level instruction files included in it. An instruction such as “run the following initialization commands” may conflict with the user’s local security intent.
- Dependencies and scripts: Lifecycle scripts triggered automatically during dependency installation can bypass any “do not execute” commitment made at the model level.
- Configuration tampering: Malicious content can modify permission settings in the workspace and add operations that previously required confirmation to the allowlist.
Along this chain, the prompt layer constraint is ineffective. It restricts the model’s intent, but these paths do not require the model to cooperate. They only require the config layer to permit the action.
3. Why Prompt-Based Constraints Are Unreliable
From a security engineering perspective, constraining model behavior with natural language has three structural weaknesses:
Injectability: Prompts mix data and instructions. When external content, such as web pages, documents, or code comments, carries instruction-like text into the context, the model has difficulty reliably distinguishing the developer’s intent from data disguised as instructions.
No enforcement semantics: “Do not execute” is a probabilistic tendency, not a hard block. Under long contexts or complex task pressure, the model may deviate from that tendency, and the system will not raise any alert.
Misplaced responsibility: Security boundaries should be enforced by deterministic components, such as configuration validation, sandboxes, and permission managers, not by probabilistic components like large language models. Placing the last line of defense in the prompt is like handing the door lock to a guard whose vigilance depends on mood.
4. Governance Approach: Make Configuration the Single Source of Authority
To address these issues, the following layered defense practices can help:
Single authority: Establish the config layer as the only authoritative source. Any permission statement in the prompt layer must also appear in the configuration file, or it is treated as invalid. Teams can maintain a “security intent checklist” and review consistency between prompt files and permission configurations during code review.
Default-deny policy: Tighten the default tool permissions from “allow with confirmation” to “deny with explicit opt-in.” Keep automatic approval only for high-frequency, low-risk operations, such as reading files in the working directory. All execution operations should require an explicit allowlist entry.
Trust levels by source: Distinguish between direct user input and externally injected content. Instruction files in a repository should not automatically inherit user-level trust. The tool should prompt the user to review them on first load. Content from download or temporary directories should be marked as untrusted and barred from triggering any automatic execution.
Sandboxing and least privilege: Even when the config layer permits execution, restrict commands to a controlled environment. Limit network access, filesystem write scope, and process creation. Cloud-based development environments can achieve this with container platforms and fine-grained access control policies, and they can retain complete execution audit records through logging services.
Change auditing and alerts: Monitor modifications to the permission configuration files themselves. Any change to the allowlist should generate an audit event and notify the user. This helps prevent a two-step bypass in which an attacker first changes the configuration and then uses the model to execute the action.
5. Closing Notes for Developers and Platform Teams
The contradiction between “the prompt says do not execute, while the config file says execution is welcome” shows a basic principle. In software development workflows that involve AI, security semantics must converge on one deterministic control surface. Natural language works well for expressing collaborative intent, but it should not carry security boundaries. Whichever vendor’s AI coding tool you use, and whether you run an in-house AI development pipeline on a cloud platform, review your permission model. Check which operations are allowed by default, examine how project-level configuration is loaded, and build an audit loop for execution actions.
Only when configuration is the single authority, and model-level constraints have a hard backstop, can AI coding assistants move beyond serving as efficiency amplifiers and become secure, controllable development partners. Otherwise, they become a hidden channel through which malicious content can slip in.
