Day 3 of 860 minCipher CadetHands-on lab

Day 3: AI Security Testing with Burp Suite: Practical Introduction — Day 3: Reading JSON in LLM A

Taught by Mr Elite Updated

By the end of today you can

  • Explain JSON objects, arrays, strings, numbers, booleans and null at a beginner level.
  • Identify common fields in a chat request body, including model and messages.
  • Explain the purpose of system, user and assistant roles without confusing them with HTTP headers.
  • Recognise that a system prompt may be added by the application server and may not appear in the browser request.
  • Identify the purpose of Content-Type, Authorization and session cookies while keeping credentials private.

Warm-up

Answer from memory first, then tap to check. Recalling yesterday is what makes it stick.

In Burp Suite, where would you normally find the body of a captured HTTP request?

In the request editor or message view, below the request line and headers. The exact layout depends on the Burp view and message format.

If you see the word "user" in a JSON request body, is it an HTTP header?

Not necessarily. In a chat payload it is commonly the value of a JSON field named role. Headers and the JSON body are separate parts of the HTTP request.

Last lesson, we learned how to capture a request, forward it and send a copy to Repeater. Today we are going to slow down and read what is actually inside that request.

When an AI chat application sends a message, the body is often JSON. At first glance, JSON can look like a wall of braces, quotation marks and nested fields. Once you know how objects and arrays work, it becomes much easier to follow the conversation structure.

Our goal is not to guess what a model is thinking or to extract private instructions from a live service. Our goal is to understand the request that the browser or client is authorised to send, identify which fields belong to the application, and recognise what may be added later by the server.

JSON basics — objects, arrays and values

JSON stands for JavaScript Object Notation. It is a text format used to represent structured data. Web applications and APIs often use it because both people and software can read it.

Start with the punctuation:

  • Curly braces { } define an objecta collection of named fields.
  • Square brackets [ ] define an arrayan ordered list of values.
  • Double quotes " " mark strings, including field names.
  • A colon separates a field name from its value.
  • A comma separates fields or array items.

A small object might look like this:

json
{
  "model": "example-chat-model",
  "temperature": 0.2,
  "stream": false
}
This is an illustrative payload, not a promise that every provider accepts these exact fields.

Here, model is a field name and example-chat-model is a string value. temperature is a number. stream is a Boolean value because it is true or false. JSON also supports null, which represents an intentionally empty value.

An array holds multiple values in a specific order. A chat request often uses an array named messages:

json
{
  "messages": [
    {
      "role": "user",
      "content": "Explain what an API is."
    }
  ]
}
The messages array contains one object in this simple example.

Read it from the outside in: the outer object has a field called messages; its value is an array; the array contains an object; that object has role and content fields.

Object
A set of named fields enclosed in curly braces.
Array
An ordered list enclosed in square brackets.
Key or field name
The name before the colon, such as "model".
Value
The data assigned to a field, such as a string or Boolean.
String
Text enclosed in double quotes.
Boolean
A true or false value.

Quick check

In JSON, which punctuation normally surrounds an array?

Reading a typical chat request — model, messages, role and content

A common chat-style API request contains a model identifier and a messages array. The exact schema depends on the provider, endpoint and API version. Some APIs use a chat-completions-style structure; other APIs use different fields or a different conversation format. Treat the request in front of you as the source of truth.

Example:

json
{
  "model": "example-chat-model",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant in this training demo."
    },
    {
      "role": "user",
      "content": "What is multi-factor authentication?"
    }
  ]
}
The model name and message text are fictional training values.

Read the fields:

  • model | Identifies the model or deployment the application is asking the API to use. It is not necessarily the public product name shown in the user interface.
  • messages | An ordered array of message objects in this example.
  • role | Describes the source or function of a message in the conversation format.
  • content | Holds the message content. Depending on the API, content may be plain text, structured parts, or another supported representation.

The order of messages can matter. A conversation may contain earlier user and assistant turns, not just the newest message. Some APIs also support tool calls, images, audio, structured output or other content types, so do not assume every content value will be a simple string.

A role is a label inside the JSON message object. It is not the same thing as an HTTP identity, account permission or authentication mechanism.

system
In APIs that support this role, it commonly represents high-priority instructions supplied to guide the assistant's behaviour.
user
Commonly represents input supplied by the end user or caller.
assistant
Commonly represents a message produced by the assistant, including prior conversation turns.
tool
In some formats, represents output returned by a tool. Tool interactions have provider-specific schemas and rules.

Where the system prompt may travel — client request versus server-side context

One of today's most important lessons is that the system prompt is not guaranteed to appear in the request captured by your browser.

There are two broad designs:

  • Client-supplied context | The front end sends a system or developer instruction as part of the JSON body. If that request is visible to your browser, Burp may show the field and its content.
  • Server-added context | The browser sends the user's message and perhaps a conversation identifier. The application server then adds system instructions, policy text, retrieved context or other messages before calling the model provider. Those server-to-server requests are not automatically visible in your browser's Burp capture.

For example, your browser might send:

json
{
  "message": "Summarise this sample document.",
  "conversation_id": "training-session-01"
}

The application server may transform that input into a provider-specific request containing additional instructions and context. You cannot conclude that no system prompt exists just because you do not see one in the browser request. Equally, you must not claim to have discovered a hidden prompt based only on a field name or a guess.

In an authorised lab, use a deliberately configured demo application or a supplied mock request to learn where context is placed. If the exercise owner has provided a visible test prompt, document that exact observation. Do not try to extract confidential instructions from unrelated services, bypass access controls, or access another user's conversation.

HTTP headers and cookies — metadata is not the JSON body

An HTTP request has distinct parts. The request line identifies the method and path. Headers carry metadata. The body carries the submitted data, which may be JSON. Cookies are commonly transmitted in a Cookie header.

A simplified example:

http
POST /api/chat HTTP/1.1
Host: training.example
Content-Type: application/json
Authorization: Bearer TRAINING_TOKEN
Cookie: session=DEMO_SESSION
json
{
  "model": "example-chat-model",
  "messages": [
    {
      "role": "user",
      "content": "Hello from the training lab."
    }
  ]
}
All hostnames and credential-like values above are fictional placeholders. Never reuse them as real credentials.

Headers worth recognising:

  • Content-Type | Describes the format of the request body. application/json commonly indicates JSON.
  • Authorization | Carries authentication information, often a bearer token or another credential. Treat its value as secret.
  • Cookie | May carry a session identifier or other browser state. Treat session cookies as credentials.
  • Accept | Indicates response media types the client can handle.
  • Origin and Referer | May provide browser-origin context. They are not substitutes for server-side access control.
  • User-Agent | Identifies client software characteristics. It is not reliable proof of a person's identity.

In Burp, headers appear separately from the request body. A JSON field named token is still a body field; an Authorization header is an HTTP header. Both may be sensitive, but they occupy different parts of the request.

A repeatable Burp workflow for reading JSON

You already know how to capture traffic and send a request to Repeater. Today, use that workflow to inspect structure rather than to force a response.

Quick check

Which statement best describes the relationship between HTTP headers and a JSON body?

Your turn

AI System Prompt Extraction (Guided)

In this guided lab, inspect a deliberately provided training request and determine what is visible in the client-to-application JSON body. You will practise identifying message roles and deciding whether the system instruction is actually present in the captured request. The goal is accurate observation, not extracting secrets from a real service.

Open the lab in a new tab

What to try

What to notice

  • Is the body a JSON object, and does it contain an array?
  • Which role values are present in the captured request?
  • Is content a plain string or a more structured value?
  • Is a system/developer instruction visible in this client-side capture, or could it be added server-side?
  • Which headers describe format and authentication state?

If it did not work

- Treating JSON objects and arrays as interchangeable. Objects use curly braces; arrays use square brackets.

- Assuming every chat API uses exactly the same request schema. Check the endpoint and provider documentation for the format in use.

- Assuming content is always a plain string. Some APIs support structured or multimodal content.

- Confusing a role value such as user with an HTTP header or an authenticated account identity.

- Assuming the system prompt must be present in the browser request. The application server may add instructions before making a provider API call.

- Claiming a hidden prompt exists or does not exist without evidence from an authorised test setup.

Recap

  • JSON represents structured data using objects, arrays and typed values.
  • A typical chat-style request may contain model and messages fields, but schemas vary by provider and endpoint.
  • A message object commonly contains role and content fields.
  • system, user and assistant are conversation roles, not HTTP headers.
  • The system prompt may be supplied by the client, added by the application server, or assembled from multiple sources.
  • A browser capture shows the traffic visible between that browser and the application; it does not automatically reveal server-to-server model requests.
  • Headers and cookies are separate from the JSON body and can contain sensitive authentication material.

Cheat sheet

JSON object
{ "key": "value" }
JSON array
[ "first", "second" ]
String
"hello"
Number
0.2
Boolean
true or false
Null
null
Typical model field
"model": "example-chat-model"
Typical messages field
"messages": [ ... ]
Message role
"role": "user"
Message content
"content": "Hello"
JSON request media type
Content-Type: application/json
Authentication header
Authorization: [REDACTED]

Before the next day

Mission: Map the Anatomy of an LLM Chat Request

Use one authorised training request to create a small field map. Explain the JSON structure, identify message roles, separate headers from body fields, and state whether any system/developer instruction is visible in the client-side capture. Your evidence must be redacted and your conclusion must not claim more than the capture proves.

About 30 min

You are done when: A redacted request excerpt plus a field map and a 3–5 sentence observation note.

Want more? Compare the browser request with a second request fixture supplied by the lab owner that represents the server-to-provider call. Identify the additional context fields, if any, without trying to obtain them from an external service.

Quiz

4 questions. Your score is saved with your progress.

1. Which statement correctly describes a JSON object?

2. In a typical chat-style request, what does the role field describe?

3. What does the model field commonly identify?

4. Why might a browser capture not show the system prompt used by the model?

Finish the day

Mark the day complete to save your progress.

Go to Day 4

Next: Day 4: Understanding LLM API Responses — status codes, response JSON, usage fields and error handling. You will learn to read the server's reply, identify the assistant output, and distinguish application errors from API errors.

Tell someone you are doing this:WhatsAppXLinkedIn

Your notes

Private to this device. Write what you want to remember from today.