---
title: Agent Environments
description: Reference for the environment variables available to Blueprints in the K12Panel Service Agent and User Agent contexts.
---

[Skip to content](https://k12panel.com/kb/writing-your-own-blueprint/agent-environments#main-content)

![test-full-word-logo.png\]](https://k12panel.com/hs-fs/hubfs/test-full-word-logo.png?height=35&name=test-full-word-logo.png)

Open main navigation

Close main navigation

- [Go to k12panel.com](https://k12panel.com)

[Go to k12panel.com](https://k12panel.com?hsLang=en)

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Online Help and Knowledge Base](https://k12panel.com/kb?hsLang=en)
2. [Writing your own Blueprint](https://k12panel.com/kb/writing-your-own-blueprint?hsLang=en)

# Agent Environments

## A reference for the environment variables available to Blueprints, for both the Service Agent and the User Agent contexts.

### Built in Variables

Predefined Constants

There are several predefined constants available for use in Validators and Workers.

| Predefined Variable   | Variable Set To   | Useful For   |
| --- | --- | --- |
| `$CLOUDSET_NAME` | Name of the ASSET as configured in the K12Panel Web UI. Example value could be “ADMIN-DESK-01” | Useful if you need a Worker script to know the Web UI name that has been configured for an ASSET in the cloud. |
| `$CLOUDSET_CHECKEDOUTUSER` | Email address of the USER that the asset is checked out to, or ““ if no user. | If you need a handle on the email address to do things like promote the user to admin (via a worker) or check to see if the currently-logged-in-user is the responsible party. |
| `$VALIDATED_WORK_DONE` | Internal and understood by Agent | Responding from a Validator |
| `$VALIDATED_WORK_NEEDED` | Internal and understood by Agent | Responding from a Validator |
| `$VALIDATED_WORK_INDETERMINATE` | Internal and understood by Agent | Responding from a Validator |
| `$VALIDATED_RUN_ALWAYS` | Internal and understood by Agent | Responding from a Validator |
| `$BLUEPRINT_VERSION` | Obtained from blueprint’s version field. | Manipulating downloaded file within blueprint |
| `$BLUEPRINT_FILENAME` | Obtained from blueprint’s filename field. | Verifying installed version against blueprint’s version within validator. |
| `$BLUEPRINT_CHECKSUM` | Obtained from blueprint’s checksum field name. | Undetermined but here for potential future use. |

 

### Agent Environments

The K12Panel Agent exposes a set of environment values you can use in Blueprints by referencing *$env:VARIABLENAME*. The exact values can differ from machine to machine depending on configuration.

There are two execution contexts, and several variables differ between them. The **Service Agent** runs in service (system) space, so user-profile paths point at the system profile. The **User Agent** runs in the logged-in user’s context, so those paths point at that user’s profile.

### Service Agent Environment (selected variables)

### User Agent Environment (selected variables)

Both contexts also expose the standard *Path*, *PATHEXT*, *PSModulePath*, *PSExecutionPolicyPreference*, and processor identifier/level/revision values.

### Common Questions

**How do I use an environment value in a Blueprint?**  
Reference it as $env:VARIABLENAME — for example $env:COMPUTERNAME.

**Why do APPDATA and USERPROFILE differ between agents?**  
The Service Agent runs in system space (system profile paths); the User Agent runs in the logged-in user’s context (their profile paths).

**What is USERNAME in the Service Agent?**  
The machine account, shown as MachineHostName$.

**Can the values vary by machine?**  
Yes. They reflect each machine’s configuration, so treat the values above as typical, not guaranteed.

- [Getting started](https://k12panel.com/kb/getting-started?hsLang=en)
- [Menu Functions](https://k12panel.com/kb/menu-functions?hsLang=en)
- [Settings](https://k12panel.com/kb/settings?hsLang=en)
- [3rd Party Integrations](https://k12panel.com/kb/3rd-party-integrations?hsLang=en)
- [PC Health and SOAR](https://k12panel.com/kb/pc-health-and-soar?hsLang=en)
- [FAQ](https://k12panel.com/kb/faq?hsLang=en)
- [K12Panel Agent](https://k12panel.com/kb/k12panel-agent?hsLang=en)
- [Blueprints Catalog](https://k12panel.com/kb/blueprints-catalog?hsLang=en)
- [Writing your own Blueprint](https://k12panel.com/kb/writing-your-own-blueprint?hsLang=en)
- [MSP Tools](https://k12panel.com/kb/msp-tools?hsLang=en)
- [Developer API](https://k12panel.com/kb/developer-api?hsLang=en)

# K12Panel Inc

k12panel.com Help Center

Copyright © 2026, K12Panel Inc