Skip to content
  • There are no suggestions because the search field is empty.

Writing good input for Peripheral

The quality of a Peripheral run depends directly on the quality of your input: an AI that has to guess drifts more, uses more tokens and gives results that differ from run to run. This article shows how to write a test goal as one testable claim, how to build a test plan in which every planned test case has a clear purpose and a check at the end, and how to keep logical test steps rough but useful. It also covers writing guardrails as rules that don't block the goal, naming data rows and variables so the AI can choose well, and using requirements and tickets as sources for Findings. A complete worked example and a checklist help you prepare before you start an execution.

 

Clean input gives clean runs, and clean runs give clean output. An AI that has to guess what you mean drifts more, uses more tokens and gives results that differ from run to run. This article is about steering the AI with precise input.

You don't have to get it right on your own: grill-me questions your test case and proposes sharper wording. But if you know what makes input good, you can judge those proposals better.


The test goal: one claim, true or false

The test goal is the most important field. Write one testable claim about the application's behaviour.

Not like this Why not But like this
The appointments module An area: what has to be true? A patient can only book an appointment in a free time slot of a doctor.
A patient books an appointment A flow: what is verified at the end? A booked appointment appears in the patient's own appointment overview.
Booking works and cancelling works Two claims Split it into two Peripheral test cases, or choose one claim.
Click "Book", fill in the form, check the toast Steps, not a claim A booked appointment is confirmed to the patient and appears in their overview.
  • No steps, no locators. The how belongs, if anywhere, in the logical test steps.
  • Name the user. "A patient", "an administrator", "a user without an account".
  • Make the result observable. Something the application shows, so it can be verified.


The test plan: every test case proves part of the claim

A test plan makes executions repeatable: every execution runs the same test cases. Without a test plan, the AI decides what it tests, and that can be different every time.

Per planned test case:

  • Title: short and distinctive, such as "Book in a free slot" or "Booking a taken slot is refused". Don't repeat the title of the Peripheral test case.
  • Purpose: what this test case proves, in one or two sentences. This is what the AI verifies at the end.
  • Logical test steps (optional): only where the route matters. They give direction, not exact steps.

Together, the planned test cases must cover the test goal as broadly as the PRA level asks: a happy path at Low, side paths and non-happy flows from Medium up.

Let grill-me propose the test plan. Grill-me reads the test goal, the PRA level, the guardrails and the requirements, and proposes planned test cases, each with a rationale. The moment you approve the first test plan is the moment Peripheral starts paying for itself.


Logical test steps: what the user does

Logical test steps describe what a user does, in the user's words:

1. Open the appointments page 
2. Choose a doctor with a free slot tomorrow
3. Book the first free slot 4. Open "My appointments"
4. Open "My appointments"

Good logical test steps:

  • Describe actions and checks a user recognises, not elements: "Book the first free slot", not "Click button#book-1".
  • Contain at least one checkable step at the end, such as "Check that the appointment is in the list". A generated test case can only pass with a verification.
  • Use base steps for what every test case starts with (logging in), and step templates for blocks that some of the test cases share.
  • Stay rough. If the application has changed, the AI can take a detour; it reports every detour, so you see where your steps and the application differ.

When the AI deviates from a logical test step, that is a detour. Detours are allowed, but they are visible: in the review you can save a detour as a guardrail, or change the step.


Guardrails: what is and is not allowed

Guardrails tell the AI what it may and may not do. Write them as rules:

  • Data: "Only change data the test created itself." "Create a new patient for every test case."
  • Routes: "Don't use the admin panel." "Stay on clinic.test."
  • Roles: "Only act as a patient."
  • Way of working: "Log in with the page action Log in as patient." "Choose a date with the date picker, never type it."

Watch out for contradictions with the test goal. If the goal needs a state the test data doesn't have (for example a completed appointment without a review), the test case has to build that state itself, and the guardrails have to allow it. A guardrail that makes the goal unreachable leads to Aborted with cause guardrail. Grill-me checks this for you.

Rules that apply to many test cases belong in a guardrail template, such as a persona or security rules.


 Test data: data sources

A Peripheral test case can use one or more data sources: data sheets from Data storage, with the rows the AI may use (the Data card in the editor).

  • The AI never sees the values. It only sees the names of the rows and the names of the variables. So give rows meaningful names (patient-with-open-invoice) and variables clear names (${patientEmail}).
  • One row is set by JOSF at the start of every test case, as a data sheet step in a Test data group.
  • More rows: the AI chooses a row per test case with a data sheet step, and may switch rows. The row in use sets the source's variables.
  • The values reach the application through the variables: a step types ${patientEmail}, and JOSF fills in the value.
  • When you promote a generated test case, the data sheet steps come along, so the promoted test case uses the same rows. To make it run data-driven over all rows, link a data source to it yourself.

Data the test creates itself

Every generated test case gets a new browser and test context, and sets up its own data. Preferably through an existing API request or page action, executed as a step: that is faster and more robust than clicking through the UI. If there is no model for it, the AI uses the UI.

Unique or dynamic values (a new name, today's date) come from JOSF's test data functions, such as ${random(…)} or the Faker functions: the subagent puts them in a variable with a set variable step, and then uses ${name}.

If the test goal needs a state your test data doesn't have, the test case has to build that state itself, and your guardrails have to allow that. Otherwise it ends as Aborted.

Environments: URLs and other settings

A Peripheral execution uses the active environment shown at the top of JOSF, just like a regular test run. Its variables are given to the AI, so the environment is the natural place for everything that differs per environment, such as the URLs of your applications, a default language or the name of a test tenant. Unlike data rows, the AI sees both the name and the value of a regular environment variable (secrets only by their alias).

The AI chooses a variable by its name, so give every variable a name that says what it is. If your test touches more than one application, name each URL after its application, for example:

Variable Value
${baseUrl} https://clinic.test
${PatientPortalURL} https://portal.clinic.test
${AdminPortalURL} https://admin.clinic.test
${AppointmentsApiURL} https://api.clinic.test/appointments

With names like these, a logical test step such as "Open the patient portal" is enough: the AI picks ${PatientPortalURL} and the generated test case contains the variable, not the address. A promoted test case therefore runs against every environment that defines the same variables, for example test and acceptance. Names such as ${url2} or ${env_a} give the AI nothing to go on.

  • Use the same variable names in every environment, so test cases work everywhere.
  • Set a base URL for the main application, so the AI can open it without being told the address.
  • Never put passwords or tokens in regular variables: use secrets for those (see below).

Variables and system data

JOSF enforces two rules that keep generated test cases repeatable:

  • Only existing variables. A step may only use ${name} if that variable exists: environment variables, the variables of a data source once the row is set, and what earlier steps have set. A step with an unknown variable is refused before it runs (otherwise it would type an empty value). A ${…(…)} with parentheses is a JOSF function and is allowed.
  • System data through variables. Data from the system (ids, tokens, links from emails, generated names or dates) must first be put in a variable and then used as ${name}. Before a step runs, JOSF refuses it if it literally contains the value of a variable from the test context (five characters or more), or something that looks generated: a UUID, a JWT or a token of 16 characters or more. Values your own input mentions are allowed. That way a promoted test case doesn't depend on the values of one run.

Secrets

Store passwords, tokens and other credentials as secrets of an environment (project settings → Environments, Secrets).

  • The AI only sees the alias of a secret and uses it as ${secret(alias)}. It never sees the value.
  • The generated test case contains ${secret(alias)}, not the value. A promoted test case therefore works in every environment that has the secret.
  • Secrets are stored encrypted behind the project password. If the project is locked on your machine, JOSF asks you to unlock it before an execution starts. If the secrets are locked during an execution, it ends as Aborted with cause environment.

Data: meaningful row names

The AI sees the names of rows and variables, never their values. So:

  • Name rows after what makes them special: patient-with-open-invoice, doctor-fully-booked.
  • Name variables after what they contain: ${patientEmail}, not ${col3}.
  • Store passwords and other credentials as secrets of an environment. The AI uses them as ${secret(alias)} without seeing them.
  • Never type a password in the test goal, the steps or the guardrails. Free text goes to the AI unchanged, can be typed literally into a step, and so ends up in a generated test case that is shared through git.

 Environment variables need meaningful names too (unlike data rows, the AI does see their values): put the URLs of your applications in the environment with a name per application, such as ${PatientPortalURL} or ${AdminPortalURL}, so the AI can pick the right one 


Requirements and tickets

Requirements give the AI the expected behaviour: acceptance criteria, business rules, part of a specification. Link the ticket of the feature instead of copying it. Keep files focused: a complete manual fills the character limit and pushes out what matters. Within the limit, tickets come before files.

Requirements matter for Findings: every Finding must name the source of its expectation. A clear requirement gives the AI something to quote.


Project knowledge: what every execution should know

Some knowledge applies to the whole project, not to one test case:

  • What the application is and what its words mean: glossary.md. The Peripheral setup can write this together with you.
  • How the agent should work in this project: AGENTS.md.
  • Lessons about operating the application: memory.md. Executions write these themselves.

A complete example

Title: Book an appointment Tags: appointments, regression

Test goal

A patient can book an appointment in a free slot of a doctor, and then sees it in their own appointment overview.

Base steps / preconditions

B1. Open the clinic's patient portal 
B2. [Step template: Log in as role] role = patient

Test plan

# Title Purpose Logical test steps
1 Book in a free slot A booked appointment appears in My appointments with the chosen doctor, date and time. 1. Open the appointments page · 2. Choose a doctor with a free slot · 3. Book the first free slot · 4. Check My appointments
2 A taken slot cannot be booked A slot that is already taken is not offered, or booking it is refused with a message. 1. Open the appointments page · 2. Try to book a taken slot · 3. Check that it is refused
3 Cancel the booking A cancelled appointment disappears from My appointments. 1. Book a free slot · 2. Cancel it · 3. Check My appointments

Guardrails

Only cancel or change appointments the test booked itself. Never log in as staff or administrator.

Data: data sheet Patients, row patient-without-appointments.

Requirements: ticket CLINIC-123.

Settings: PRA level Medium.


Checklist before you start an execution

  • ☐ The test goal is one claim, true or false, without steps.
  • ☐ There is a test plan, and every planned test case has a clear purpose.
  • ☐ Every planned test case has (or implies) a check at the end.
  • ☐ The guardrails don't make the goal unreachable.
  • ☐ The data the test needs exists, or the test may create it.
  • ☐ Credentials are secrets, not free text.
  • ☐ The right environment and browser are active (top bar of JOSF).
  • ☐ You have run grill-me at least once.