What is a side effect?

Definition

In software, a side effect changes something outside a function's returned value. Examples include writing a file, updating a database, sending a request, creating a message or changing an account setting.

Agent tools need accurate side-effect descriptions because labels can be misleading. An interface presented as read-only may still cause writes if its underlying endpoint accepts state-changing requests.

ELI5

A side effect is an extra change that happens while software performs an action. Looking up information should only read it, while saving a note changes something other people or later runs can see.

For example, a tool may appear to open a page for reading but also send a request that updates the page. That update is a side effect.

Frequently asked questions

Why do side effects matter for AI agents?

Agents can repeat or combine tool actions, so hidden writes may alter data, influence later runs or exceed the user's intended permission.

How can developers control side effects?

They can use explicit tool contracts, least-privilege permissions, server-side enforcement, logging and tests that verify actual state changes.

Videos explaining side effect