Skip to content

Glossary: Building with LLMs Basics

eval() and exec()

Also written: eval, exec

Python functions that run a string as code. Never pass model output to them, because the output may be wrong or steered by an attacker.

Where the book teaches it

Related terms

Untrusted inputPrompt injection