• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

When Claude Agent Says “Sandbox It” — What Does That Really Mean?

Sascha Оффлайн

Sascha

Заместитель Администратора
Команда форума
Администратор
Регистрация
9 Май 2015
Сообщения
1,549
Баллы
155
The Profound Shift Behind One Piece of Advice From Anthropic


If you've thoroughly read Anthropic's latest

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

, you'll notice a seemingly simple but crucial piece of advice right at the beginning:

For security and isolation, the SDK should run inside a sandboxed container environment.
This isn't just a recommendation from Anthropic's official documentation — it's a "ticket to the game" that Anthropic has drawn for the next generation of AI Agent applications.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Every Claude Agent has its own "Agent virtual machine." This virtual machine has its own file system, runtime (Bash, Python, Node.js), and a set of file modules known as "Skills." In other words, future AI Agents are no longer mere processes running on existing systems, but "digital artisans" with their own independent "bodies" and "workshops".

When Claude Code tells you "you need sandboxing," what does it really mean? What core characteristics, fundamentally different from traditional web applications, must an AI Agent's runtime environment possess?

Today, let's deconstruct this "subtext" one by one.

Deconstruction 1: From "Process" to "Fortress" - The Absolute Requirement for Isolation


Official Requirement: Sandboxing is for achieving process isolation, resource limits, and network control.

Real Meaning: AI Agents execute untrusted, dynamically generated code. Anthropic explicitly tells you that you cannot trust it. You need a "digital fortress" to contain it, preventing it from escaping, attacking your host system, or other tenants. Although traditional Docker containers provide some isolation, their "shared kernel" architecture always carries the risk of being compromised by kernel vulnerabilities.

How AgentSphere Meets and Exceeds:
From day one, we chose a MicroVM (Firecracker-based) architecture that's more secure than containers.

  • Kernel-level isolation: Each AgentSphere sandbox has its own independent kernel, fundamentally eliminating "container escape" risks.
  • Native resource limits: You can precisely define CPU and memory quotas when creating sandboxes.
  • Network moat: Platform-level network policies can finely control each sandbox's outbound access, preventing malicious code from connecting to unauthorized addresses.
Deconstruction 2: From "Stateless" to "Stateful" - The Core Need for Memory


Official Requirement: The SDK is a "long-running process" that executes commands in a "persistent shell environment" and manages files in a "working directory".

Real Meaning: Your AI Agent needs "memory." It's not a stateless API that forgets everything after a call. It needs to operate in a stable environment, remembering the previous step's operations, file modifications, and even long-running processes. Simple serverless functions or temporary exec calls can no longer meet this demand.

How AgentSphere Meets and Exceeds:

  • Persistent file system: Each AgentSphere sandbox has a complete, writable file system—perfect for the Agent's "working directory."
  • True "long-running": You can create sandboxes that run for hours or even days, keeping your "email Agent" or "monitoring Agent" online 24/7.
  • Unique "pause/resume" capability: For Agents that need "intermittent memory" (like personal project managers), AgentSphere's pause() and resume() functions can completely save and restore memory and file system state, achieving more economical and flexible state management than "long-running."
Deconstruction 3: From "Single Mode" to "Lifecycle Management" - The Ultimate Test of Flexibility


Official Requirements: The documentation lists multiple deployment modes in detail, such as "Ephemeral Sessions", "Long-Running Sessions", and "Hybrid Sessions".

Real Meaning: There's no one-size-fits-all deployment solution. A mature AI application must flexibly manage the lifecycle of its backend computing resources based on different task types (one-time code fixes vs. continuous chatbots). Your infrastructure must have this fine-grained, programmable lifecycle management capability.

How AgentSphere Meets and Exceeds:
AgentSphere's SDK is designed for this fine-grained management. It abstracts complex underlying resources into simple, intuitive API calls.

Anthropic Deployment ModeAgentSphere SDK Implementation
Ephemeral Sessionsconst sandbox = await Sandbox.create(); ... await sandbox.kill();
Long-Running Sessionsconst sandbox = await Sandbox.create({ timeoutMs: 24 * 3600 * 1000 });
Hybrid Sessionsawait sandbox.pause(); ... const sbx = await Sandbox.resume(id);

We not only meet all officially listed modes but also provide a more elegant and cost-effective "hybrid session" implementation through pause/resume.

Three Lines of Code: AgentSphere "Houses" Your Claude Agent


Using AgentSphere to provide a home that meets official best practices for your Claude Agent SDK — how simple is it?


import { Sandbox } from 'agentsphere-js';

// 1. Create a dedicated, persistent "cloud computer" for your Agent
const sandbox = await Sandbox.create('claude-agent-sdk', { // Template ID as first parameter
timeoutMs: 8 * 60 * 60 * 1000 // timeoutMs in milliseconds
});

// 2. Load your agent's "skills" (e.g., an invoice processing script) onto its filesystem
await sandbox.files.write('/path/to/process_invoice.js', 'file content')

// 3. Command it to execute tasks and get results
const result = await sandbox.commands.run('node process_invoice.js');




It's that simple. You don't need to worry about virtualization technology, server operations, or session management. You just focus on the Agent's business logic, while AgentSphere provides that secure and reliable "body."

Conclusion: AgentSphere, Born for Claude Agent Best Practices


When Claude Code tells you "you need sandboxing," it's actually describing a blueprint for future AI infrastructure. The core requirements of this blueprint are: absolute isolation, reliable state management, and flexible lifecycle control.

And AgentSphere is the "AI-native execution layer" born to implement this blueprint in the simplest, most economical, and most secure way. The entire architecture perfectly aligns and deeply resonates with Claude Code's best practices for production environments.

AgentSphere perfectly answers all requirements raised by Anthropic.

Anthropic's "Production Requirements"AgentSphere's "Native Implementation"Your Benefits
Sandboxed ContainerAgentSphere Secure Sandbox (MicroVM)You get kernel-level isolation based on Firecracker that's more secure than containers, fundamentally eliminating security risks.
Persistent Environment and Working DirectoryAgentSphere's Sandbox File SystemEach sandbox has a complete, writable file system that perfectly supports Agent state retention and file operations.
Diverse Session ModesAgentSphere's Lifecycle API- Sandbox.create() + kill() = Ephemeral Sessions
- Sandbox.create({ timeoutMs: 24 * 3600 * 1000 }); = Long-Running Sessions
- sandbox.pause() + resume() = Hybrid Sessions
Resource Limits and Network ControlAgentSphere's Templates and Security PoliciesYou can preset CPU/memory limits in templates and finely control each sandbox's outbound access through platform-level network policies.

Ready to equip your Claude Agent with a more powerful "dedicated computer" that goes beyond official standards?


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

|

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

|

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.





Источник:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу