# Wykonywanie kodu w piaskownicy

EN: **Sandboxed code execution for assistants** · id `codeexecution` · aliases: code interpreter, code execution tool, sandboxed execution, interpreter kodu, piaskownica kodu

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Aplikacje LLM i agenci](https://aiatlasgraph.com/t/applications.md) › [Narzędzia i integracje](https://aiatlasgraph.com/t/tools.md) › Wykonywanie kodu w piaskownicy

## Description

- PL: Narzędzie pozwalające modelowi uruchamiać wygenerowany kod (zwykle Python lub powłokę) w izolowanym kontenerze i odczytywać wyniki oraz pliki.
- EN: A tool letting a model run generated code (usually Python or a shell) in an isolated container and read back outputs and files.

## In one sentence

- PL: Asystent może napisać krótki program, uruchomić go w odizolowanym miejscu i użyć prawdziwego wyniku zamiast liczyć „na oko”.
- EN: The assistant can write a short program, run it somewhere isolated, and use the real result instead of estimating.

## Problem it solves

- PL: Modele językowe mylą się w obliczeniach i nie potrafią same przetworzyć dużego arkusza ani narysować wykresu.
- EN: Language models make calculation mistakes and cannot process a large spreadsheet or draw a chart on their own.

## What it does

- PL: Daje asystentowi kalkulator i warsztat w zamkniętym pokoju: może eksperymentować, ale niczego poza nim nie zepsuje.
- EN: It gives the assistant a calculator and workshop in a locked room: it can experiment without breaking anything outside.

## Everyday example

- PL: Wrzucasz wyciąg z konta, a asystent liczy wydatki w kategoriach, rysuje wykres i zwraca plik z tabelą.
- EN: You upload a bank statement, and the assistant totals spending by category, draws a chart and returns a table file.

## This concerns you if you…

- PL: analizujesz arkusze lub pliki z danymi przy pomocy asystenta
- PL: potrzebujesz dokładnych obliczeń, nie przybliżeń
- PL: budujesz agenta, który ma uruchamiać własny kod
- EN: analyse spreadsheets or data files with an assistant
- EN: need exact calculations rather than approximations
- EN: are building an agent that runs its own code

## Keywords

code interpreter · sandbox · isolated container · container reuse · Python · Bash · resource limits · data analysis agents

## How it works

- PL: Model generuje kod jako wywołanie narzędzia; serwer uruchamia go w izolowanym kontenerze z limitami pamięci, CPU i czasu. Standardowe wyjście, błędy i wygenerowane pliki wracają do kontekstu, więc model może poprawiać kod iteracyjnie. Konkretna implementacja może blokować sieć, ograniczać biblioteki i zachowywać pliki lub stan interpretera między wywołaniami.
- EN: The model emits code as a tool call; a server runs it in an isolated container with memory, CPU and time limits. Standard output, errors and generated files return to context so the model can fix code iteratively. A particular implementation may block network access, restrict libraries and preserve files or interpreter state across calls.

## Limits

- PL: Izolacja musi być szczelna, bo wykonywany kod pochodzi od modelu, którym mogą sterować wstrzyknięte instrukcje. Brak sieci i stały zestaw bibliotek ograniczają zadania; czas pracy kontenera kosztuje, a dane przechowywane w nim podlegają zasadom retencji.
- EN: Isolation must be tight because the executed code comes from a model that injected instructions can steer. No network and a fixed library set limit tasks; container time costs money, and data stored in it is subject to retention rules.

## Key terms

- PL: **piaskownica**: Odizolowane środowisko ograniczające dostęp wykonywanego kodu do reszty systemu.
- PL: **stan REPL**: Zmienne i załadowane dane interpretera zachowane między kolejnymi wywołaniami.
- EN: **sandbox**: An isolated environment limiting executed code's access to the rest of the system.
- EN: **REPL state**: Interpreter variables and loaded data kept between successive calls.

## Know first

- [Bezpieczeństwo agentów: uprawnienia i izolacja (AI agent security)](https://aiatlasgraph.com/t/agentsecurity.md)

## Sources

- [Code execution tool (Claude API documentation)](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool>) `claude-code-execution-docs` · by Anthropic

---

AI Atlas revision 124 (2026-10-31) · HTML: https://aiatlasgraph.com/t/codeexecution · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-31
