---
title: "Untrusted code"
url: https://www.daytona.com/definitions/u/untrusted-code
---

# Untrusted code

Untrusted code is code that runs without anyone having reviewed what it will do.

Untrusted code is code that runs before anyone has checked its behavior. Trust here is not a judgment about the intent of the author, who may be an attacker or a model doing its best. Code becomes trusted only after someone accountable has reviewed it or vouched for it. Trust is a property of the path the code took, not of the code itself.

Because no one has checked the code, the safe assumption is that it may do anything its environment allows. The defense therefore lies in limiting the environment rather than the code. Reading the code first helps less than it seems, because code can hide its behavior or fetch more code once it runs. Limits on the environment hold whatever the code does.

Untrusted code is common wherever programs run code they did not write. An AI agent produces it at every step, and so does any service that runs code submitted by its users. Agents write and run code faster than any person can review it. Untrusted code runs with the permissions of whatever started it, unless something takes those away. A sandbox is the usual way to take them away.

## Related terms

- [Agent harness](https://www.daytona.com/definitions/a/agent-harness.md)
- [Code execution](https://www.daytona.com/definitions/c/code-execution.md)
- [Code interpreter](https://www.daytona.com/definitions/c/code-interpreter.md)
- [Container](https://www.daytona.com/definitions/c/container.md)
- [Docker](https://www.daytona.com/definitions/d/docker.md)
- [DPU (Data Processing Unit)](https://www.daytona.com/definitions/d/dpu-data-processing-unit.md)
