LAI #150: Can a Sandbox Stop a Hostile Agent?
From the publisher’s feed, collected in the ZeroLabs newsroom.
All five sandboxes blocked the attack. None protected the keys you handed the agent.Good morning, AI enthusiasts!An agent that can run for hours, remember past work, call tools, use credentials, and accept new instructions is useful for the same reasons it is hard to control.You have to decide what it can access, what it should remember, who is allowed to redirect it, which actions need approval, and what happens when something fails halfway through. Those choices increasingly define the system’s behavior as much as the model itself.We have several good examples of that this week. You’ll learn:When long-running agents need durable execution instead of one process staying aliveWhat five different sandboxes actually stopped when tested with the same hostile agentHow to separate semantic, episodic, and procedural memory in an agentWhy the first token takes longer than the rest during LLM inferenceHow coding tools handle steering while an agent is already runningHow Microsoft Foundry scores unsafe content and where teams set the thresholdsPlus, a community project that lets you mix regular code, model calls, autonomous agent steps, and human approvals in the same TypeScript workflow.Let’s get into it!What’s AI WeeklyThis week in What’s AI, I spoke with Tony Holdstock-Brown, co-founder and CEO of Inngest, about what actually breaks when an agent runs for hours or days. Their data suggests the model is often not the main problem: server timeouts or dropped connections appeared in 41% of affected accounts, compared with 15% for LLM API errors.The main idea is to stop treating a long-running agent as one loop that stays alive in memory. Instead, split the work into steps and save each result outside the process. If one step fails, you retry that step rather than restarting the whole run. The same applies to waits for approvals, webhooks, or customer replies: pause the run, hold no compute, and resume when the event arrives.We also get into what an agent should remember versus re-read, why side effects such as refunds and emails need idempotency, how deploys can break runs that started under older code, and why token budgets and iteration caps need to live inside the agent. The full article covers when a simple queue is enough, when durable execution starts to make sense, and how to test whether an agent can actually recover from failure. Read it here!AI Tip of the DayPromising an LLM a $200 tip or telling it “my job depends on this” was a popular prompting trick in 2023. Today, researchers at Wharton tested these exact lines across modern models and proved that they do nothing. Sometimes they even lower your accuracy.While running benchmarks for our AI Engineering for Production book, we first started by removing contradictory instructions.A prompt might say “explain every detail” near the top and “keep it brief” later. The model then has to decide which instruction matters more. In one of our test notebooks, removing two conflicting instructions reduced a 382-word response to 171 words on the first run, without asking the model to “try harder.”Now, before shipping a prompt, we focus on three things:Finding conflicting instructions. Give the draft prompt to a strong reasoning model and ask which rules conflict, overlap, or are vague. Then fix those conflicts instead of adding more instructions.Setting reasoning effort through the API. Delete lines like “try really hard” or “take a deep breath.” If the model supports it, set the reasoning or thinking level directly in the API call.Enforcing structure with a schema. If your application needs JSON, define the required schema through structured outputs instead of repeatedly telling the model how to format its answer.— Louis-François Bouchard, Towards AI Co-founder & Head of CommunityLearn AI Together Community Section!Featured Community post from the DiscordCarlosmartineztuanama_87198 built Chloe, an open-source TypeScript runtime for building AI agents that run on your own machine. Instead of treating every task as fully agentic, it lets you choose how much autonomy each step needs:work.step() for regular codework.model() for a structured model responsework.agent() for tasks that need an agent to investigate and actwork.ask() when a human needs to approve something before the workflow continuesYou define each agent in TypeScript, including its model, tools, memory, jobs, and channels, and can run jobs manually, on a schedule, or from chat. The runtime stays local, while an optional cloud connection gives you remote access to the dashboard. Check it out here and support a fellow community member. If you have questions or feedback, share them in the thread!Collaboration OpportunitiesThe Learn AI Together Discord community is flooding with collaboration opportunities. If you are excited to dive into applied AI, want a study partner, or even want to find a partner for your passion project, join the collaboration channel! Keep an eye on this section, too; we share cool opportunities every week!1. _joshan_ is building a rough prototype for an AI startup and is looking for a technical co-founder. If you have an AI/ML background and want to get into the startup space, connect with them in the thread!2. _joshua171 is looking for collaborators to start building something together, share ideas, and even explore a potential long-term partnership. If you want more details, reach out to them in the thread!3. Debashish_parida5 is building an open-source Python framework designed to provide modular, extensible building blocks for RAG systems, autonomous agent execution, and multimodal pipelines. They are looking for help with multimodal integration, high-performance storage & retrieval, agent state management, and testing & refinement. If this is your area of expertise, contact them in the thread!Meme of the week!Meme shared by bin4ry_d3struct0rTAI Curated SectionArticle of the weekI Ran One Fake Hostile Agent Through Five Sandboxes on My Mac by Hubert NakielskiSandboxing can limit what a coding agent can access, but the protection also depends on what you mount, which credentials you provide, and where the agent can connect. This article runs the same simulated hostile agent through macOS Seatbelt, a hardened container, Docker Sandboxes, gVisor, and Firecracker, with canary secrets planted to test each setup. All five blocked access to a protected key and prevented deletion of the project, but credentials deliberately passed to the agent remained readable and could be sent to any permitted host.Our must-read articles1. Episodic, Semantic, and Procedural Memory in AI Agents by Montasir MahmudAgent memory becomes harder to manage when facts, past experiences, and behavioral instructions are all stored in the same store. This article separates memory into three types in LangGraph: semantic memory for facts, episodic memory for past events that can be reused as examples, and procedural memory for instructions the agent can update through reflection. It gives each type its own namespace, write conditions, and place in the prompt, and explains how updates should differ.2. LLM Inference: What Actually Happens Inside an LLM by Ahmad BilalThe first token of an LLM response usually takes longer to produce than the tokens that follow because prefill and decoding perform different work. This article follows one prompt through a decoder-only transformer, covering tokenization, embeddings, Query-Key-Value attention, prefill, decoding, and the KV cache. It then connects those mechanics to GPU memory bandwidth and metrics such as time to first token, before explaining how continuous batching, PagedAttention, and speculative decoding improve inference performance.3. The Steering Wheel Problem: run.steer(), turn/steer and Who May Redirect a Running Agent by Ali Süleyman TOPUZSeveral coding tools let a user redirect an agent while it is already running, but that creates a permissions problem when steering instructions can come from other sources. This article compares how Cursor, Codex, Grok Build, and Alook handle steering and examines why MCP annotations such as readOnlyHint do not provide enforcement on their own. It then builds a .NET prototype that restricts steering with turn-ID checks, allowlists, and approvals tied to SHA-256 hashes of the requested action. Prompt injection through shared communication channels remains unresolved, so the design still relies on human approval for sensitive changes.4. Guardrails in Microsoft Foundry: How Content Safety Scoring Works by KatakamvivekMicrosoft Foundry can score model inputs and outputs for hate, sexual content, violence, and self-harm, but teams still have to decide which severity levels their application should allow. This article explains how Content Safety scoring works and shows how to configure guardrails at both the model and agent levels. It also covers Prompt Shields for jailbreaks and indirect prompt injection, and builds a Python pipeline that checks both input and output and fails closed when the safety service cannot return a result. The article finishes with latency and cost considerations, PyRIT red teaming, and a checklist for testing guardrails before deployment.If you are interested in publishing with Towards AI, check our guidelines and sign up. We will publish your work to our network if it meets our editorial policies and standards.LAI #150: Can a Sandbox Stop a Hostile Agent? was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.