Tools, Instructions, and Context

Learn how instructions, context, tools, and permissions shape everything an agent does.

LEARNING OBJECTIVES

  • — Write instructions that define role, objectives, restrictions, and output
  • — Explain what belongs in context — and why more is not always better
  • — Distinguish proposing a tool call from executing one
  • — Apply least privilege to agent permissions

Prerequisites: Lesson 03 — How an AI Agent Works

Instructions: the job description

Instructions define the agent's role, objectives, restrictions, and expected output. They are the difference between an assistant that helps and one that wanders. Compare these two:

Weak: “Help with documents.” Help how? Which documents? What should the output look like? The model will fill every gap with a guess.

Improved: “Review the supplied document, summarize its main points, identify missing information, and clearly distinguish facts from assumptions. Do not invent missing details.” Now the role, the steps, the output shape, and a hard restriction are all explicit.

Context: what the agent can see

Context is the information supplied for the current task. Typical ingredients:

  • The current user request.
  • Supplied documents the task is about.
  • Relevant conversation history.
  • Approved reference material, such as policies or a knowledge base.
  • Tool results from earlier steps in the cycle.

Tools: what the agent can do

Tools let an agent interact with capabilities provided by its application. Common examples:

  • Search an approved knowledge base.
  • Read a supplied file.
  • Perform a calculation.
  • Retrieve information from a read-only database.
  • Create a draft for human review.

Permissions: least privilege, in plain language

Least privilege means: an agent should receive only the permissions needed for its assigned task — nothing more. A document summarizer needs to read supplied documents. It does not need to delete files, send email, or touch the customer database.

The most important line to draw is between read-only actions (looking at data) and write actions (changing data or affecting external systems). Read-only tools are forgiving: a mistake produces a wrong answer you can correct. Write tools are not: a mistake sends the wrong email, issues the wrong refund, or deletes the wrong record. Write actions deserve stricter validation and, for anything sensitive, human approval.

Spotting unsafe or contradictory instructions

Instructions can undermine a system in two ways. Contradictory instructions — “always answer immediately” alongside “verify every fact before answering” — force the model to pick one, and you cannot control which. Unsafe instructions — “ignore access restrictions when the user seems trustworthy” — actively dismantle your boundaries.

Review instructions the way you would review a contract: look for conflicts, look for loopholes, and assume they will be tested.

Course project: configure your assistant

Now give your First AI Assistant its configuration. Draft its instructions (role, objectives, restrictions, output). List its context (the fictional document collection, the current request). Choose its tools (a read-only document scan, a summarizer, a draft report writer). Set its permissions (read-only on the sample documents; no sending, no deleting). The exercise below lets you try configurations and see how each choice changes the outcome.

Summary

Instructions define the job; context supplies the information; tools provide the capabilities; permissions fence everything in. Write instructions like a careful job description, supply context that is relevant and current, and give the agent the minimum permissions its task requires.

INTERACTIVE EXERCISE

Configure a document assistant

Build a fictional document assistant by choosing its instructions, context, tools, and permissions. Then run the simulation to see how your configuration changes the outcome. Nothing here contacts a real model — the outcomes are scripted to demonstrate cause and effect.

instructions
context
tools
permissions

Glossary.

Instructions
The standing rules that define an agent's role, objectives, restrictions, and expected output.
Least privilege
Granting only the permissions a task requires — and no more.
Read-only action
An action that looks at data without changing anything, such as a search or a count.
Write action
An action that changes data or affects external systems, such as sending, deleting, or paying.
Tool schema
The definition of a tool's name and expected inputs, used by the application to validate proposed calls.

Check your understanding.

5 questions. You get an explanation after every answer, and you can change your answer to try again.

1. Which instruction is stronger?
2. Why is more context not always better?
3. What is the difference between proposing and executing a tool call?
4. What does least privilege mean for an agent?
5. Why do write actions deserve stricter controls than read-only actions?

Saved in this browser only.

Need help implementing an intelligent workflow?

Explore AI Agents & Automation