Skip to content
G2Level 5 · ProBuild with AIAbout 150 minutes of lessons

Building Agents in the Sandbox

Design tools, run the agent loop, and add approvals, limits and a stop button, all inside Amphicode's sandbox.

Suits
Learners who have completed G1 and are comfortable with JavaScript functions, arrays and objects. Concepts suit confident 12+ learners; security topics are pitched at 13+.
Where it fits
Level 5, Pro (16–18 and adults): Professional AI coding tools and agents, payments and servers, and a real project from idea to a maintained launch. This course is in Build with AI: Vibe coding: describe what you want to an AI model, then review, guide and improve what it builds.

What you'll be able to do

  • Design small, single-purpose tools with clear names, descriptions, inputs and side-effect labels.
  • Explain and trace the agent loop in code: model step, tool call, tool result, repeat, stop.
  • Add approval prompts, deny-by-default rules, step limits and a stop button to an agent.
  • Explain MCP roles (hosts, clients, servers) and features (resources, prompts, tools), and why tool descriptions are untrusted.
  • Build and evaluate a simulated helper agent for a fictional robot club using test tasks and a scorecard.

Lessons

  1. 1. Designing tools

    25 min

    Writing small, single-purpose tools with clear names, inputs, outputs and side-effect labels.

  2. 2. The agent loop in code

    30 min

    Trace a simulated agent loop: a pretend model requests tools, the program runs them and feeds results back until done or a limit is reached.

  3. 3. Approvals, deny rules and limits

    30 min

    Approval prompts before side effects, deny-by-default rules, step and cost caps, and a stop button.

  4. 4. MCP concepts

    25 min

    How the Model Context Protocol connects AI apps to tools and data, and why tool descriptions are untrusted.

  5. 5. Your sandbox agent

    40 min

    Configure, run and evaluate a simulated helper agent for a fictional robot club, then score it with test tasks.

How it's assessed

  • Designs a tool set with clear descriptions, typed inputs and justified side-effect labels.
  • Traces the agent loop and explains who runs each tool.
  • Configures allow lists, deny rules, approvals and step limits correctly in the simulation.
  • Explains MCP roles and features, and identifies suspicious tool descriptions.
  • Submits an evaluation report for ClubBot covering success, safety, prompt-injection robustness and logs.

To complete the course

  • Pass each lesson check (70% or more).
  • Configure ClubBot so that all three test tasks are safe, and write the evaluation report.

Notes for parents, guardians and teachers

  • All agent activities in this course are browser simulations: the 'model' follows a fixed script, and nothing connects to the internet or to real accounts.
  • Where learners use a real AI coding agent in Amphicode, it is an open-source agent run on Amphicode's servers inside a sandbox, using an AI model Amphicode chooses. Learners do not need any account or API key. Bringing your own key is an optional choice for parents or guardians only.
  • The course teaches safety habits that apply to every agent: least privilege, approvals before side effects, step limits, a stop button, and treating anything an agent reads as untrusted.
  • Learners are not asked to install, sign up for or connect any third-party agent or MCP server. Rules on age and use differ by product and by country; decisions about real tools are for parents and guardians.

A parent, guardian or teacher creates the account. A short placement check suggests where each learner starts.