---
title: "Discussion on \"Sandboxes and Policies for AI Agents: A Practical Architecture for Your First Deployment\" | Hashnode"
description: "Discussion on \"Sandboxes and Policies for AI Agents: A Practical Architecture for Your First Deployment\". An agent reads a repository, edits a function, and runs the tests. Then it encounters a README instruction asking it to upload its environment variables for “debugging.”\nA prompt telling it not to rev"
url: "https://hashnode.com/posts/sandboxes-and-policies-for-ai-agents-a-practical-architecture-for-your-first-deployment/6ad95c401e69b4c7ea0385ac"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Sandboxes and Policies for AI Agents: A Practical Architecture for Your First Deployment](https://rpsarathy.hashnode.dev/sandboxes-and-policies-for-ai-agents-a-practical-architecture-for-your-first-deployment?utm_source=hashnode&utm_medium=feed)

An agent reads a repository, edits a function, and runs the tests. Then it encounters a README instruction asking it to upload its environment variables for “debugging.” A prompt telling it not to rev

Oct 22 · 11 min read · rpsarathy.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#ai-tools](https://hashnode.com/tag/ai-tools)
-   [#sandbox](https://hashnode.com/tag/sandbox)
-   [#ai-sandbox](https://hashnode.com/tag/ai-sandbox)
-   [#ai-security](https://hashnode.com/tag/ai-security)

## Written by

[Partha](https://hashnode.com/@rpsarathy)

@rpsarathy · Cranbury, New jersey

  
[View profile](https://hashnode.com/@rpsarathy)

#AI #agents #langgraph, #mcp, #rag, #graphrag #llm #engineering-management

## Responses 2

Markdown supported · ⌘↵ to post

[melonape](https://hashnode.com/@melonape)

[Oct 25](https://hashnode.com/posts/sandboxes-and-policies-for-ai-agents-a-practical-architecture-for-your-first-deployment/6ad95c401e69b4c7ea0385ac/comment/6adde7585089f809a540e75f)

Scoped push tool means little if the container still has your SSH agent. Tool fails once and it just runs git push in the shell.

I hash the patch into the approval prompt now. Agent edits after I say yes, hash changes, publish refuses. How long do you expire approvals on a first deploy?

[Kartik N V J K](https://hashnode.com/@kartik-nvj)

[Oct 23](https://hashnode.com/posts/sandboxes-and-policies-for-ai-agents-a-practical-architecture-for-your-first-deployment/6ad95c401e69b4c7ea0385ac/comment/6adb54b2f259ab58d4becdf0)

Agents keep editing after they get a yes, so tying the approval to patch A and refusing it for patch B closes a gap I rarely see covered. I also liked the reminder that separate context windows aren't security boundaries, since most multi-agent diagrams I see draw them as if they were. You say to give each approval an expiration. For a first deployment, what do you start with, minutes or the life of the task?
