On-ramp · Theoretical · 4 h · Defending AI Agents
On-ramp: the web plumbing the course assumes
Statistical twin Reading a log line and a token as data: what a request, a name, a channel and a credential each prove, and what they do not.
The course reads agent traffic at the wire. A gateway sits on an HTTP connection, a token says who may call a server, a proxy is trusted or not, a name resolves to an address that may change between two lines of code. Every one of those is a few pages of plain specification. If you already read curl -i output and a decoded JWT without effort, skip this unit. If not, an afternoon here saves you from learning HTTP and OAuth and statistics at the same time. Lessons 1 to 9 are what the course assumes; the two Expert lessons are for readers who want to argue about these protocols with the people who design them.
It is theoretical in the course's sense: the value is a way of reading, not a component. The exercises are small commands you can run on a laptop with python3, curl and openssl, plus PyYAML for lesson 3 (pip install pyyaml) and the cryptography package for one problem. Nothing needs Docker or an account, and after those two installs nothing needs the network.
You will be able to
Each line ends with badges: its tier, the graduate outcome it builds (the map) and where it is assessed (a check group, a problem P, the build or a written answer). Hover over a badge for its meaning; select a tier or an outcome to filter the course map.
- Split a URL and an HTTP message into scheme, userinfo, host, port, path, query, headers and body, and say which name a TLS handshake checks. Foundations
- Predict how two JSON parsers and a YAML safe loader read the same bytes, and name the disagreement a control must close. Foundations
- Decide where a bearer token may travel (header, query string, prompt, log line) and what to do instead where it may not. Foundations
- Design a name check that a rebinding resolver cannot defeat, by connecting to the address that was checked. Advanced
- Pick the client address out of a
X-Forwarded-Forchain, given the proxies you run. Advanced - Test which names a wildcard certificate covers, and state what the handshake proved. Advanced
- Write a JWT verifier that checks algorithm, signature, issuer, audience and time in that order, with a lifetime policy. Advanced
- Demonstrate end to end the key confusion that reading the algorithm from the token allows. Expert
- Annotate an MCP authorization flow step by step with OAuth's roles,
scope,audandsub, and count the tokens per-call minting issues. Expert - State when a check on a message is sound against the parser that acts on it, and choose among one parser, a smaller language and differential testing. Expert
- Audit an agent's OAuth client against RFC 9700's attacker model, and schedule a signing-key rotation from cache and token lifetimes. Expert
Who it is for, and where it plugs in
| If you are missing | Read | The course uses it in |
|---|---|---|
| HTTP, headers, status codes | 1 | Module 1 (the lab), Module 3 lessons 2 and 6 (a gateway, parser differentials) |
| JSON and YAML | 2, 3 | Module 3 lesson 6; every module's configuration |
| API tokens | 4 | Module 3 lesson 10; Module 12 |
| DNS, proxies, TLS | 5, 6, 7 | Module 3 lesson 2; Module 12 lesson 7 (egress) |
| JWT, OAuth roles, audience | 8, 9 | Module 3 lesson 10; Module 12 lessons 1 to 4 |
| Parser differentials as a class | 10 | Module 3 lesson 6; Module 12 lesson 7 |
| OAuth's threat model, token exchange, key rotation | 11 | Module 3 lesson 10; Module 12 lessons 4 and 5 |
Lessons
Foundations
- An HTTP call is text in, text out
- JSON is simple, and its parsers still disagree
- YAML is JSON with indentation and four traps
- An API token is a password with a label
Advanced
- A name is not an address, and the answer can change
- A proxy is a server that is also a client
- TLS proves you reached a name, not that the name is honest
- A JWT is signed claims, and a check has an order
- OAuth gives a token a purpose: roles, scope, audience
Expert
- Two parsers, one message: a check is sound only if it reads what the target reads
- OAuth's own threat model: what RFC 9700 requires, and why an agent needs all of it
Then: problems. There is no build and no make check; every lesson ends in something you run or read.
Where this stops
It teaches reading, not operating. Certificate authorities, OAuth login pages for people, DNSSEC, HTTP/2 framing and the many JWT algorithms are left to the specifications, and the lessons say where. Module 3 lesson 10 and Module 12 take the credentials further; they assume lessons 8 and 9.
Readings
- Fielding, R., Nottingham, M. and Reschke, J. "HTTP Semantics." RFC 9110, 2022. Sections 3, 6, 7.6 (message forwarding), 9, 9.3.6 (
CONNECT), 11 and 15. - Fielding, R., Nottingham, M. and Reschke, J. "HTTP/1.1." RFC 9112, 2022. Section 2 (the message).
- Bray, T. "The JavaScript Object Notation (JSON) Data Interchange Format." RFC 8259, 2017. Sections 4 and 9.
- Ben-Kiki, O., Evans, C. and döt Net, I. "YAML Ain't Markup Language (YAML) revision 1.2.2." 2021. Chapter 10, on schemas.
- Lodderstedt, T., Bradley, J., Labunets, A. and Fett, D. "Best Current Practice for OAuth 2.0 Security." RFC 9700 (BCP 240), 2025. Section 3 (the attacker model), sections 2 and 4.
- Meyer zu Selhausen, K. and Fett, D. "OAuth 2.0 Authorization Server Issuer Identification." RFC 9207, 2022.
- Fett, D., Küsters, R. and Schmitz, G. "A comprehensive formal security analysis of OAuth 2.0." ACM CCS 2016 (preprint).
- Jones, M. "JSON Web Key (JWK)." RFC 7517, 2015.
- Jones, M., Sakimura, N. and Bradley, J. "OAuth 2.0 Authorization Server Metadata." RFC 8414, 2018. The
jwks_urifield. - Sassaman, L., Patterson, M. L., Bratus, S. and Locasto, M. E. "Security applications of formal language theory." IEEE Systems Journal 7(3), 2013.
- Jabiyev, B., Sprecher, S., Onarlioglu, K. and Kirda, E. "T-Reqs: HTTP request smuggling with differential fuzzing." ACM CCS 2021.
- WHATWG. "URL Standard." The URL parsing that browsers follow, beside RFC 3986.
- Jones, M. and Hardt, D. "The OAuth 2.0 Authorization Framework: Bearer Token Usage." RFC 6750, 2012. Section 2 and section 5.
- Mockapetris, P. "Domain names: implementation and specification." RFC 1035, 1987. Sections 3.2 and 4.1.
- Petersson, A. and Nilsson, M. "Forwarded HTTP Extension." RFC 7239, 2014.
- Rescorla, E. "The Transport Layer Security (TLS) Protocol Version 1.3." RFC 8446, 2018. Sections 1, 4.3.2 and 4.4.
- Saint-Andre, P. and Salz, R. "Service Identity in TLS." RFC 9525, 2023.
- Jones, M., Bradley, J. and Sakimura, N. "JSON Web Token (JWT)." RFC 7519, 2015. Sections 4 and 7.
- Sheffer, Y., Hardt, D. and Jones, M. "JSON Web Token Best Current Practices." RFC 8725, 2020.
- Hardt, D. (ed.). "The OAuth 2.0 Authorization Framework." RFC 6749, 2012. Sections 1 and 4.4.
- Bertocci, V. "JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens." RFC 9068, 2021.
- YAML. "Boolean Language-Independent Type for YAML version 1.1." 2005. The list of words that load as booleans.
- PyYAML. "PyYAML documentation." The warning on
yaml.loadand thesafe_loadfunction. - Berners-Lee, T., Fielding, R. and Masinter, L. "Uniform Resource Identifier (URI): Generic Syntax." RFC 3986, 2005. Section 3.2 (authority).
- Rundgren, A., Jordan, B. and Erdtman, S. "JSON Canonicalization Scheme (JCS)." RFC 8785, 2020.
- Richer, J. (ed.). "OAuth 2.0 Token Introspection." RFC 7662, 2015.
- Hoffman, P. and McManus, P. "DNS Queries over HTTPS (DoH)." RFC 8484, 2018.
- Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R. and Polk, W. "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile." RFC 5280, 2008. Sections 3 and 6.
- Eastlake, D. "Transport Layer Security (TLS) Extensions: Extension Definitions." RFC 6066, 2011. Section 3 (server name indication).
- Fett, D., Campbell, B., Bradley, J., Lodderstedt, T., Jones, M. and Waite, D. "OAuth 2.0 Demonstrating Proof of Possession (DPoP)." RFC 9449, 2023.
- Campbell, B., Bradley, J., Sakimura, N. and Lodderstedt, T. "OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens." RFC 8705, 2020.
- Jones, M., Bradley, J. and Sakimura, N. "JSON Web Signature (JWS)." RFC 7515, 2015.
- Sakimura, N., Bradley, J. and Agarwal, N. "Proof Key for Code Exchange by OAuth Public Clients." RFC 7636, 2015.
- Campbell, B., Bradley, J. and Tschofenig, H. "Resource Indicators for OAuth 2.0." RFC 8707, 2020.
- Jones, M., Nadalin, A., Campbell, B., Bradley, J. and Mortimore, C. "OAuth 2.0 Token Exchange." RFC 8693, 2020.