<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lucas</title>
    <description>The latest articles on DEV Community by Lucas (@lukie81).</description>
    <link>https://dev.to/lukie81</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4084111%2F81f25da4-981a-41bc-9e4e-54458dff865d.jpg</url>
      <title>DEV Community: Lucas</title>
      <link>https://dev.to/lukie81</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lukie81"/>
    <language>en</language>
    <item>
      <title>Why I Don’t Want AI Coding Agents to Have Shell Access by Default</title>
      <dc:creator>Lucas</dc:creator>
      <pubDate>Wed, 19 Aug 2026 01:33:41 +0000</pubDate>
      <link>https://dev.to/lukie81/why-i-dont-want-ai-coding-agents-to-have-shell-access-by-default-kng</link>
      <guid>https://dev.to/lukie81/why-i-dont-want-ai-coding-agents-to-have-shell-access-by-default-kng</guid>
      <description>&lt;p&gt;AI coding agents are becoming very good at working with real codebases.&lt;/p&gt;

&lt;p&gt;They can inspect a repository, trace bugs across multiple files, suggest architectural changes, write tests, and increasingly implement entire features.&lt;/p&gt;

&lt;p&gt;But there is a security question I think we are moving past too quickly:&lt;/p&gt;

&lt;p&gt;How much access does an AI actually need to do useful work?&lt;/p&gt;

&lt;p&gt;When I want an AI model to review my code, I usually want it to do things like:&lt;/p&gt;

&lt;p&gt;understand the project structure;&lt;br&gt;
read source files;&lt;br&gt;
search for symbols or patterns;&lt;br&gt;
trace how components interact;&lt;br&gt;
identify bugs;&lt;br&gt;
review a proposed implementation.&lt;/p&gt;

&lt;p&gt;None of those tasks inherently require unrestricted shell access.&lt;/p&gt;

&lt;p&gt;Yet many agent workflows bundle code access together with capabilities such as:&lt;/p&gt;

&lt;p&gt;executing shell commands;&lt;br&gt;
running Git;&lt;br&gt;
launching processes;&lt;br&gt;
reading arbitrary filesystem locations;&lt;br&gt;
modifying arbitrary files.&lt;/p&gt;

&lt;p&gt;That makes the agent much more capable.&lt;/p&gt;

&lt;p&gt;It also dramatically increases the blast radius when something goes wrong.&lt;/p&gt;

&lt;p&gt;Capability and access are different things&lt;/p&gt;

&lt;p&gt;A stronger model does not necessarily need stronger permissions.&lt;/p&gt;

&lt;p&gt;Suppose I ask an AI:&lt;/p&gt;

&lt;p&gt;Review the authentication implementation and tell me if you see any security issues.&lt;/p&gt;

&lt;p&gt;For that task, the model needs information.&lt;/p&gt;

&lt;p&gt;It needs to read the relevant repository.&lt;/p&gt;

&lt;p&gt;It probably does not need permission to:&lt;/p&gt;

&lt;p&gt;run arbitrary commands&lt;br&gt;
read my entire home directory&lt;br&gt;
inspect unrelated projects&lt;br&gt;
modify source files&lt;br&gt;
access credentials&lt;br&gt;
delete files&lt;/p&gt;

&lt;p&gt;This seems obvious when written out.&lt;/p&gt;

&lt;p&gt;But developer tooling often treats repository access and machine access as almost the same thing.&lt;/p&gt;

&lt;p&gt;I wanted to separate them.&lt;/p&gt;

&lt;p&gt;The principle: least privilege&lt;/p&gt;

&lt;p&gt;Traditional security engineering has a simple idea:&lt;/p&gt;

&lt;p&gt;Give a system only the permissions it needs to perform its job.&lt;/p&gt;

&lt;p&gt;AI agents should not be an exception.&lt;/p&gt;

&lt;p&gt;If I am using one model as a reviewer, its permissions should reflect the role of a reviewer.&lt;/p&gt;

&lt;p&gt;That might mean:&lt;/p&gt;

&lt;p&gt;✓ list repository files&lt;br&gt;
✓ read approved files&lt;br&gt;
✓ search the repository&lt;/p&gt;

&lt;p&gt;✗ execute shell commands&lt;br&gt;
✗ run Git&lt;br&gt;
✗ launch processes&lt;br&gt;
✗ read outside the repository&lt;br&gt;
✗ arbitrarily modify source code&lt;/p&gt;

&lt;p&gt;This doesn't eliminate every risk.&lt;/p&gt;

&lt;p&gt;But it turns the question from:&lt;/p&gt;

&lt;p&gt;"Do I trust this AI with my computer?"&lt;/p&gt;

&lt;p&gt;into something much narrower:&lt;/p&gt;

&lt;p&gt;"Do I trust this AI to inspect this repository through these specific operations?"&lt;/p&gt;

&lt;p&gt;That is a much easier security boundary to reason about.&lt;/p&gt;

&lt;p&gt;This is why I built RepoRelay&lt;/p&gt;

&lt;p&gt;I recently built an open-source project called RepoRelay around this idea.&lt;/p&gt;

&lt;p&gt;RepoRelay is an MCP server that sits between an AI client and a local repository.&lt;/p&gt;

&lt;p&gt;The architecture is roughly:&lt;/p&gt;

&lt;p&gt;AI / ChatGPT&lt;br&gt;
      ↓&lt;br&gt;
Secure MCP connection&lt;br&gt;
      ↓&lt;br&gt;
RepoRelay&lt;br&gt;
      ↓&lt;br&gt;
one explicitly approved repository&lt;/p&gt;

&lt;p&gt;Instead of exposing a general-purpose shell or filesystem API, RepoRelay exposes a deliberately small set of repository operations.&lt;/p&gt;

&lt;p&gt;The read-only surface is essentially:&lt;/p&gt;

&lt;p&gt;open_workspace&lt;br&gt;
list_files&lt;br&gt;
read_file&lt;br&gt;
search_files&lt;/p&gt;

&lt;p&gt;The important part isn't the number of tools.&lt;/p&gt;

&lt;p&gt;It's what isn't there.&lt;/p&gt;

&lt;p&gt;There is no shell tool.&lt;/p&gt;

&lt;p&gt;There is no Git tool.&lt;/p&gt;

&lt;p&gt;There is no process-execution tool.&lt;/p&gt;

&lt;p&gt;There is no generic "write this file anywhere" tool.&lt;/p&gt;

&lt;p&gt;The approved repository becomes the boundary.&lt;/p&gt;

&lt;p&gt;"One repository" sounds simple. It isn't.&lt;/p&gt;

&lt;p&gt;A security boundary based on filesystem paths has plenty of edge cases.&lt;/p&gt;

&lt;p&gt;Checking that a requested path starts with:&lt;/p&gt;

&lt;p&gt;C:\Projects\my-app&lt;/p&gt;

&lt;p&gt;is nowhere near sufficient.&lt;/p&gt;

&lt;p&gt;A tool like this has to think about things such as:&lt;/p&gt;

&lt;p&gt;.. traversal;&lt;br&gt;
absolute paths;&lt;br&gt;
path canonicalization;&lt;br&gt;
symbolic links;&lt;br&gt;
junctions and reparse points;&lt;br&gt;
hard links;&lt;br&gt;
sensitive files;&lt;br&gt;
hidden credential locations;&lt;br&gt;
bounded reads and searches.&lt;/p&gt;

&lt;p&gt;For example, a request for:&lt;/p&gt;

&lt;p&gt;../../some-other-project/.env&lt;/p&gt;

&lt;p&gt;should obviously fail.&lt;/p&gt;

&lt;p&gt;But the less-obvious escape mechanisms matter just as much.&lt;/p&gt;

&lt;p&gt;RepoRelay therefore treats containment as an enforced security property rather than a prompt instruction.&lt;/p&gt;

&lt;p&gt;The AI isn't being told:&lt;/p&gt;

&lt;p&gt;"Please stay inside this folder."&lt;/p&gt;

&lt;p&gt;The server is supposed to make leaving the folder impossible through the tools it exposes.&lt;/p&gt;

&lt;p&gt;That distinction is important.&lt;/p&gt;

&lt;p&gt;Sensitive files deserve another boundary&lt;/p&gt;

&lt;p&gt;Even inside an approved repository, there are files I usually don't want an AI reviewer reading.&lt;/p&gt;

&lt;p&gt;The most obvious example is:&lt;/p&gt;

&lt;p&gt;.env&lt;/p&gt;

&lt;p&gt;A repository may also contain credentials, private keys, or other sensitive material.&lt;/p&gt;

&lt;p&gt;So "the AI may read this repository" should not automatically mean:&lt;/p&gt;

&lt;p&gt;"The AI may read every byte under this directory."&lt;/p&gt;

&lt;p&gt;RepoRelay blocks classes of sensitive paths separately from the repository-root boundary.&lt;/p&gt;

&lt;p&gt;That gives you two layers:&lt;/p&gt;

&lt;p&gt;Is this inside the approved repository?&lt;br&gt;
                ↓&lt;br&gt;
              yes&lt;br&gt;
                ↓&lt;br&gt;
Is this file allowed to be exposed?&lt;br&gt;
                ↓&lt;br&gt;
              yes&lt;br&gt;
                ↓&lt;br&gt;
              read&lt;/p&gt;

&lt;p&gt;Again, none of this is revolutionary security theory.&lt;/p&gt;

&lt;p&gt;It's applying established ideas to AI tooling.&lt;/p&gt;

&lt;p&gt;Reviewer and implementer should not always be the same agent&lt;/p&gt;

&lt;p&gt;This led me to another design decision.&lt;/p&gt;

&lt;p&gt;I often use one AI system to implement code and a stronger model to review the result.&lt;/p&gt;

&lt;p&gt;Those are different roles.&lt;/p&gt;

&lt;p&gt;The implementer may genuinely need local execution capabilities:&lt;/p&gt;

&lt;p&gt;edit code&lt;br&gt;
run tests&lt;br&gt;
compile&lt;br&gt;
use Git&lt;/p&gt;

&lt;p&gt;The reviewer often doesn't.&lt;/p&gt;

&lt;p&gt;So instead of giving both agents identical privileges, I prefer a workflow like:&lt;/p&gt;

&lt;p&gt;Local coding agent&lt;br&gt;
      ↓&lt;br&gt;
implements change&lt;br&gt;
      ↓&lt;br&gt;
repository / commit&lt;br&gt;
      ↓&lt;br&gt;
RepoRelay&lt;br&gt;
      ↓&lt;br&gt;
strong reviewer model&lt;br&gt;
      ↓&lt;br&gt;
review&lt;/p&gt;

&lt;p&gt;This also creates a useful separation of concerns.&lt;/p&gt;

&lt;p&gt;The model that wrote the code isn't necessarily the model that decides the code is good.&lt;/p&gt;

&lt;p&gt;But what if the reviewer needs to request changes?&lt;/p&gt;

&lt;p&gt;Pure read-only access is the cleanest security model, and RepoRelay supports it.&lt;/p&gt;

&lt;p&gt;But I also wanted to experiment with a constrained reviewer → implementer workflow.&lt;/p&gt;

&lt;p&gt;Instead of allowing arbitrary writes, RepoRelay can expose a few predetermined handoff files.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;/p&gt;

&lt;p&gt;ChatGPT&lt;br&gt;
   ↓&lt;br&gt;
NEXT_TASK.md&lt;/p&gt;

&lt;p&gt;local coding agent&lt;br&gt;
   ↓&lt;br&gt;
implements changes&lt;br&gt;
   ↓&lt;br&gt;
RESULT.md&lt;/p&gt;

&lt;p&gt;ChatGPT&lt;br&gt;
   ↓&lt;br&gt;
REVIEW.md&lt;/p&gt;

&lt;p&gt;The reviewer can communicate what should happen next without gaining generic write access to the source tree.&lt;/p&gt;

&lt;p&gt;That's a very different permission from:&lt;/p&gt;

&lt;p&gt;"Edit whatever file you want."&lt;/p&gt;

&lt;p&gt;The goal is not zero capability.&lt;/p&gt;

&lt;p&gt;The goal is bounded capability.&lt;/p&gt;

&lt;p&gt;Why not just use operating-system permissions?&lt;/p&gt;

&lt;p&gt;OS-level isolation is valuable, and a tool like RepoRelay is not a replacement for containers, VMs, sandboxing, or proper system permissions.&lt;/p&gt;

&lt;p&gt;Those solve a broader problem.&lt;/p&gt;

&lt;p&gt;RepoRelay is trying to solve a narrower one at the application layer:&lt;/p&gt;

&lt;p&gt;What operations should this particular AI client be able to invoke?&lt;/p&gt;

&lt;p&gt;Those layers can complement each other.&lt;/p&gt;

&lt;p&gt;You might eventually have:&lt;/p&gt;

&lt;p&gt;OS / container sandbox&lt;br&gt;
        +&lt;br&gt;
MCP-level capability restrictions&lt;br&gt;
        +&lt;br&gt;
repository containment&lt;br&gt;
        +&lt;br&gt;
sensitive-file filtering&lt;/p&gt;

&lt;p&gt;Security tends to work better when it does not depend on a single control.&lt;/p&gt;

&lt;p&gt;What RepoRelay does not claim&lt;/p&gt;

&lt;p&gt;I think security-oriented projects should be explicit about their limitations.&lt;/p&gt;

&lt;p&gt;RepoRelay is not an operating-system sandbox.&lt;/p&gt;

&lt;p&gt;If malicious software is already running under your user account, an MCP server cannot magically secure the rest of the machine from that software.&lt;/p&gt;

&lt;p&gt;It also doesn't make AI-generated code safe.&lt;/p&gt;

&lt;p&gt;A reviewer can still miss vulnerabilities.&lt;/p&gt;

&lt;p&gt;The purpose is narrower:&lt;/p&gt;

&lt;p&gt;Reduce the authority granted to the AI connection itself.&lt;/p&gt;

&lt;p&gt;That still matters.&lt;/p&gt;

&lt;p&gt;If the task requires reading four source files, giving the model the ability to execute arbitrary commands is unnecessary additional authority.&lt;/p&gt;

&lt;p&gt;AI tooling needs better permission design&lt;/p&gt;

&lt;p&gt;As models improve, I think permission design is going to matter more, not less.&lt;/p&gt;

&lt;p&gt;A weak model with powerful permissions is dangerous because it can make mistakes.&lt;/p&gt;

&lt;p&gt;A very capable model with powerful permissions deserves careful thought for a different reason: it can do much more.&lt;/p&gt;

&lt;p&gt;The answer can't simply be:&lt;/p&gt;

&lt;p&gt;"The model is smarter now, so give it everything."&lt;/p&gt;

&lt;p&gt;We should be asking:&lt;/p&gt;

&lt;p&gt;What is the smallest useful interface for this task?&lt;/p&gt;

&lt;p&gt;For code review, that interface can be surprisingly small.&lt;/p&gt;

&lt;p&gt;And once the permissions are explicit, they become much easier to inspect, test, audit, and reason about.&lt;/p&gt;

&lt;p&gt;RepoRelay is open source&lt;/p&gt;

&lt;p&gt;RepoRelay is still a very new project, and I'm actively working on the security model and developer experience.&lt;/p&gt;

&lt;p&gt;It's MIT licensed and available on GitHub:&lt;/p&gt;

&lt;p&gt;github.com/Lukie-81/RepoRelay&lt;/p&gt;

&lt;p&gt;You can install it through npm:&lt;/p&gt;

&lt;p&gt;npm install -g reporelay-mcp@latest&lt;/p&gt;

&lt;p&gt;I'm especially interested in feedback from people working on MCP, agent security, local-first tooling, and coding-agent workflows.&lt;/p&gt;

&lt;p&gt;I'm sure there are threat-model assumptions and edge cases I haven't considered yet.&lt;/p&gt;

&lt;p&gt;That's also part of why I wanted to make it open source.&lt;/p&gt;

&lt;p&gt;The broader question is bigger than RepoRelay:&lt;/p&gt;

&lt;p&gt;When an AI only needs access to your code, why should we automatically give it access to your machine?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
    </item>
  </channel>
</rss>
