SKILL.md body becomes the system prompt; everything below is the user prompt your agent receives alongside it.
Understanding this structure helps you write better SKILL.md instructions — you can reference the injected blocks by name, avoid duplicating information that’s already provided, and tailor your instructions to complement the runtime context.
Prompt Structure
Here’s the full user prompt for a webhook-triggered agent with a GitHub token credential:Agent Config
params field from your agent’s config.toml. Use it to pass configuration values that your agent’s instructions can reference — repo names, label filters, thresholds, or any structured data your agent needs.
Your SKILL.md instructions can reference this directly, e.g.: “Read the repo and labels from <agent-config> to determine which issues to process.”
See Agent Config Reference for details on the params field.
Credential Context
GITHUB_TOKEN is set and the gh CLI is ready to use.
The block also includes SSH clone instructions and a security policy that instructs the agent never to leak credentials in logs, comments, or API calls.
You don’t need to repeat any of this in your SKILL.md. The agent already knows it can use gh and git — your instructions just need to say what to do, not how to authenticate.
See Credentials Reference for all credential types and their injected context.
Environment
/tmp is writable and the root filesystem is read-only. In host-user mode, the agent’s working directory is /tmp/al-runs/<instance-id>/. The setenv command persists environment variables in both modes.
See Environment Commands for setenv details, and Container Filesystem for the full mount table.
Trigger Context
The final section varies by how the agent was triggered. This is the only part of the prompt that changes between runs.Webhook
SKILL.md instructions should describe how to handle the events your agent subscribes to.
See Webhooks Reference for the full payload schema.
Scheduled
Manual
al run, the agent instead receives:
Agent Call
Skills
If your agent enables skills likelock or subagent, additional instruction blocks are injected between the <environment> block and the trigger context. These teach the agent the commands it can use — rlock/runlock for resource locks, or al-subagent/al-subagent-wait for subagent calls.
Skill blocks only appear when explicitly enabled in your SKILL.md frontmatter.
Dynamic Context Injection
Beyond the assembled prompt, you can inject runtime data into yourSKILL.md body using the !`command` syntax. This runs shell commands during container startup and replaces the markers with their output — useful for fetching live data before the LLM session begins.
See the Dynamic Context Guide for details.
Writing Better Instructions
Now that you know what the agent receives automatically, here are some tips:- Don’t repeat what’s injected. You don’t need to tell the agent about
GITHUB_TOKENor filesystem constraints — it already knows. - Reference injected blocks by name. Say “Read the config from
<agent-config>” rather than hardcoding values. - Handle your trigger types. If your agent subscribes to both cron and webhooks, your instructions should cover both paths — the trigger context tells the agent which one fired.
- Keep instructions focused on behavior. The runtime context handles the “how” (credentials, environment, tools). Your
SKILL.mdshould focus on the “what” and “why.”