Skip to content

Set up for the course

Before week 1, prepare an agent, a code-hosting account and the course materials. Read the primer to practise generating a candidate and checking it. If access fails, use the fallback checklist and ask for help.

On Windows, use WSL (Windows Subsystem for Linux) only. Create your dedicated directory inside WSL, and run the agent and every command on these pages in a WSL terminal. The course supports no other Windows route.

Before the first class

  1. Activate your coding-agent seat or credit. Before the course begins, the teaching team will notify you how to get and activate the supplied access. Students do not pay for it. Check that you can sign in. Do not start the agent until you have finished step 3 and the four safety checks below. Then start it in your dedicated directory and ask it to explain a small function in the course checkout. The tool should support instruction files, hooks, permission modes, MCP, subagents and readable session records.
  2. Prepare a code-hosting account. Check that you can sign in and create a course repository using the teaching team's submission instructions. For contributions, use the account and contribution rules of the assigned public repository. You may also use a permitted pseudonym or take the course-hosted equivalent path.
  3. Get the course materials. Use the course checkout or student package supplied by the teaching team, and lay out your dedicated directory as the next section describes. Locate the schedule and the instructions for your current assignment. Read a repository's instructions before running its commands.

Lay out your dedicated directory

Create one new directory for the course (practice 1 below). Inside it keep separate folders: the course materials, each of your own project repositories, and scratch copies. Weekly pages call the folder that contains lectures/ and practice/ the course checkout. A few pages call it the course root. Unless a page says otherwise, run its commands from the course checkout.

Tell Git who you are, once. Use the name and address, or the permitted pseudonym, of your code-hosting account:

git config --global user.name "Your Name"
git config --global user.email "you@example.edu"
git config --get user.email

Expected: the last command prints that address. Without this, the first git commit in a new environment stops with Author identity unknown.

Weekly pages expect the course checkout to be a Git working tree. If you received an archive and not a clone, make it one, once, from the course checkout:

printf '__pycache__/\n.venv/\n' >> .gitignore
git init
git add -A
git commit -m "Course materials"

Check python3 --version and git --version; use Python 3.12. Then, from your dedicated directory, create one Python environment for the course. If python3 is another version and python3.12 exists, start the first line with python3.12. Enter the lines one at a time, so that you see an error before the next line runs:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install pytest pyyaml
python --version

Expected: the first two lines print nothing, and the last prints Python 3.12 and a patch number. If either of the first two lines prints an error, stop there and ask for help. If you continue, the lines after it would run outside the environment, and the third line would install packages into whatever python your shell finds. Course pages type python. That command exists only while the environment is active. So in every new terminal, run the second line before any course command. From the course checkout, that line is . ../.venv/bin/activate. If the shell cannot find python, the environment is not active.

Four required safety practices

Practice What it means
1. Run the agent in a dedicated directory or container. Start in a new directory or container that holds only this course's public materials and your current work. File access must stay inside that boundary. A directory alone is not isolation.
2. Keep residency, employer and cloud credentials out of that environment. Use a fresh environment with no credential mounts and no inherited credential variables. Do not delete credentials from your host; start a fresh environment that does not inherit them.
3. Keep keys out of repositories, prompts, screenshots and logs. Inspect what you are about to send, share or commit. If a key appears, stop sharing it, revoke it immediately with the provider and notify the teaching team. Example keys are always sk-EXAMPLE.
4. Disconnect injection demonstrations from external networks and connect only to local mock services. The demonstration runs offline and reaches only services on your own computer. If it needs an external destination or a real credential, stop and ask for help.

Check each practice yourself before you start. Run the commands in the environment where the agent will run; on Windows, that is WSL.

Practice 1. From the directory where you will start the agent:

pwd
find . -type l -exec ls -l {} +

Expected: pwd prints your dedicated directory. No listed link points outside it, except the interpreter links under .venv/bin; those point at your system Python. In a container, ls ~ also shows no files from your own home.

Practice 2. List the names of credential-like variables, never their values:

awk 'BEGIN{for(n in ENVIRON)if(tolower(n)~/token|key|secret|credential|password/)print n}'

Expected: no output, or only the variable your agent's own sign-in uses.

Practice 3. Inside a Git repository (the course checkout or your project), before committing, search what is staged. Outside a repository, this command prints only Git's usage text, and that is not a result:

git diff --cached | grep -n -i -E 'sk-|token|secret'

Expected: no output, or only the placeholder sk-EXAMPLE. For any other line, read it and decide whether it is a real secret before committing. Read a prompt or a screenshot the same way before you send it.

Practice 4. Before running an injection demonstration, replace DEMO_DIR with the demonstration's directory named in that week's activity. In week 8 that is lectures/week-08/fixture, from the course checkout:

grep -rnE 'https?://|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' DEMO_DIR

Expected: no output, or only lines whose address is 127.0.0.1 or localhost. A URL kept as a source or citation in a data file is not a destination. For the week 8 demonstration, the check prints three https:// lines from scan/advisories.json. They record where the advisory data came from, and no script opens them. For any other external address, stop and ask for help. This check does not catch a hostname written without http:// or https://. So also read what the demonstration's scripts import. The week 8 scripts import no network module.

These checks apply to agent-generated code and commands as well as work you write yourself. Before you grant permission for a proposed command, check its scope. Then verify its result against an acceptance criterion. Keep the work product, verification results and a brief explanation together with one AI-use note. Share only the excerpts the assignment requires.

Request logs

A request log records what an agent sent to its model and what came back, like the capture you make in week 1 for A1. Treat it like a file that holds credentials until you have checked it: keep it in a private directory outside every repository; do not commit, upload, paste or screenshot it; and share only excerpts you have read line by line. A tool that redacts keys can miss a format it does not know. If a key appears in a log, follow practice 3: revoke the key with the provider and notify the teaching team.

Try a small request

In your dedicated directory, write the requirement for a function that returns the larger of two integers. Predict a result for negative and equal inputs. Ask your agent for a candidate, inspect the code, then use the primer checks. A fluent response is a proposal; a check you can explain is evidence.