es-python command line
Every EyalSec option you can give es-python on the command line, and the environment variable that does the same thing, in one reference.
How options and the dashboard combine
Most of these options switch something on for one run, without touching the dashboard. When the dashboard has an explicit On or Off for the same setting on this machine (or globally), the dashboard wins; when it is left unset, the option decides. See Not set means inherit.
The normal way to configure a machine is the dashboard's Configure modal. The options here are for a quick local run, a test, or a place where you cannot reach the dashboard.
Command-line flags
EyalSec flags go before the script name or -m, like any other Python option. Anything after the script name is passed to your program untouched.
es-python --make-socket-vuln --report-env app.py --port 8080
# ^ EyalSec options ^ script ^ your program's own arguments
Sources
Each flag switches on one taint source for this run. All of them are off by default.
| Flag | Switches on | Details |
|---|---|---|
--make-socket-vuln |
data received over the network | socket |
--make-file-vuln |
data read from files | file |
--make-stdin-vuln |
data read from standard input | stdin |
--make-env-vuln |
environment variable values and command-line arguments | env |
--make-foreign-vuln |
data read from, and code loaded from, files other users can change | foreign |
--make-weakrandom-vuln |
values from the non-cryptographic random generator | weak_random |
--make-secret-vuln |
credentials written in your source code | hardcoded |
--make-db-rows-vuln |
values read back out of a database | db_rows |
--make-everything-vuln |
all of the above except foreign | everything |
--make-everything-vuln never includes foreign. Add --make-foreign-vuln as well if you want it.
Blocking
The raise flag makes es-python stop a risky operation instead of only reporting it. It is the older, whole-run way to get Report and Raise.
| Flag | Effect |
|---|---|
--raise |
when untrusted data reaches a risky operation, raise a RuntimeError there instead of letting it run |
--raise-on-found |
the same as --raise |
--raise only applies while the machine has no Raise rules of its own. As soon as the machine (or your global settings) has at least one Raise rule, the rules alone decide what is blocked and the flag is ignored. --raise also needs at least one source switched on, because with no source nothing is untrusted. See Report and Raise.
What each event carries
These choose what extra context is sent with every event. A --no-report-… switch on the machine always wins over the dashboard. See Sent with each event for what each one contains and how secrets are masked.
| Flag | Effect | Default |
|---|---|---|
--no-report-cmdline |
do not send the command line | the command line is sent |
--report-env |
send the program's environment variables | not sent |
--report-code |
send a short listing of your source around where the data entered and where it was used | not sent |
--no-report-env |
never send the environment, whatever the dashboard says | not set |
--no-report-code |
never send source listings, whatever the dashboard says | not set |
--no-report-inventory |
do not send the list of installed packages and web routes at exit | not set |
Maintenance and information
These do not change what is detected. You rarely need them.
| Flag | Effect |
|---|---|
--name |
print the account, machine, environment and zone this es-python reports to, then exit |
--update |
replace this es-python with the newest build, keeping this machine's registration, settings and events. If it is already the newest, nothing changes |
-r, --refresh |
fetch this machine's latest settings from EyalSec, waiting for the answer, before running. On its own (no script) it fetches and exits |
-cc N, --check-config N |
like --refresh, but wait at most N milliseconds for the answer (0 means wait) |
-h, --help |
print all options, including these, and where the on-machine manual is |
Fuzzing flags
es-python also accepts --fuzz, --fuzz-socket, --fuzz-files, --fuzz-stdin, --fuzz-foreign, --fuzz-everything and --rf. These are for advanced testing, are not needed for normal use, and are outside this guide. You can safely ignore them.
Environment variables
Every es-python command-line flag has an environment variable that does the same thing, for when you cannot change the command line (a service manager, a container entry point, a test runner). Set it to exactly 1 to switch it on; other values such as true or yes are ignored. For pipelines and images, see Run es-python in CI and Use es-python in a container.
ES2_MAKE_SOCKET_VULN=1 es-python app.py
export ES2_REPORT_ENV=1
| Variable | Same as |
|---|---|
ES2_MAKE_SOCKET_VULN=1 |
--make-socket-vuln |
ES2_MAKE_FILE_VULN=1 |
--make-file-vuln |
ES2_MAKE_STDIN_VULN=1 |
--make-stdin-vuln |
ES2_MAKE_ENV_VULN=1 |
--make-env-vuln |
ES2_MAKE_FOREIGN_VULN=1 |
--make-foreign-vuln |
ES2_MAKE_WEAKRANDOM_VULN=1 |
--make-weakrandom-vuln |
ES2_MAKE_SECRET_VULN=1 |
--make-secret-vuln |
ES2_MAKE_DB_ROWS_VULN=1 |
--make-db-rows-vuln |
ES2_MAKE_EVERYTHING_VULN=1 |
--make-everything-vuln |
ES2_RAISE=1 |
--raise |
ES2_RAISE_ON_FOUND=1 |
--raise-on-found |
ES2_NO_REPORT_CMDLINE=1 |
--no-report-cmdline |
ES2_REPORT_ENV=1 |
--report-env |
ES2_REPORT_CODE=1 |
--report-code |
ES2_NO_REPORT_ENV=1 |
--no-report-env |
ES2_NO_REPORT_CODE=1 |
--no-report-code |
ES2_NO_REPORT_INVENTORY=1 |
--no-report-inventory |
ES2_REFRESH=1 |
--refresh |
ES2_CHECK_CONFIG=N |
--check-config N |
Environment variables are inherited by child processes, so a program that starts other es-python programs passes them on. A flag applies only to the process you give it to. As with Python's own variables, these are ignored when es-python runs with -E or -I.
Variables with no flag
A few settings exist only as environment variables.
| Variable | Effect | Details |
|---|---|---|
ES2_FOREIGN_CODE_ALLOW=/path:/other/path |
exempt code under these absolute path prefixes from the foreign source | foreign |
ES2_PREFER_APP_LIBS=name:name |
let your own copy of the named libraries win over the bundled ones | Bundled libraries |
ES2_NO_BUNDLED_LIBS=1 |
let your own copy of every bundled library win | Bundled libraries |
ES2_NO_SYSTEM_SITE=1 |
do not share your regular Python's installed packages | Packages |
Run under a template
--template NAME protects one run with a rule template, without changing your rules in the dashboard. Give it more than once to use several templates, up to 16:
es-python --template privesc app.py
es-python --template privesc --template network-rce app.py
Like the other EyalSec flags, --template goes before the script name, -c or -m. After them it is passed to your program as one of its own arguments.
A name is one of the ready-made names below, else a template you saved, else a template EyalSec published. Case does not matter. When a template blocks an operation, es-python raises a RuntimeError there, as a Raise rule does.
| Name | What it does on the run |
|---|---|
default |
what an account's Default configuration starts as: blocks attacks from the network, from files, from files other local users can change, and from environment variables and arguments, and a credential in your code reaching a log |
privesc |
blocks files other local users can change from running as you, or from steering what you run, load or overwrite |
network-rce |
blocks commands, code, templates and unsafe YAML built from network data |
internet |
for web apps and APIs: blocks code execution, injection, XML attacks, path traversal, SSRF, cross-site scripting, forged tokens and denial of service from the network |
files |
for pipelines that take files from others: blocks archive escapes, XML entity attacks, decompression and regex bombs, deep JSON and unsafe YAML, from files and from the network |
secret-logging |
blocks a credential written in your code from reaching a log |
ci |
for build jobs where the pull request writes environment variables, arguments and files: blocks code, templates and unsafe YAML built from them |
llm |
blocks model output from running commands, code, queries or internal fetches |
containers |
blocks code and programs from world-writable volumes, and requests to private or metadata IP addresses |
owasp-top10 |
blocks the OWASP Top 10 (2025) attacks es-python can see while your program runs |
low-noise |
stops sending regular expression, string formatting, file lookup, and DNS and TLS setup events; its other rules only change what the dashboard shows |
regulated-data |
only changes what the dashboard shows, so it changes nothing on the run |
Each one is described in full under Ready-made templates. A template switches on, for that run, the inputs its block rules watch (network data for network-rce, for example), so you do not need a --make-...-vuln flag as well. A rule on an input a template cannot switch on (the database identity check, fuzzer input or web requests) only applies when that input is switched on for the machine.
At startup es-python prints one line per template, saying what it applies:
es-python: template privesc: 8 block rules; watching files other users can change
es-python: template regulated-data: changes what the dashboard shows only; nothing applies on this machine
es-python does not start your program, and exits with status 2, when:
- a template is not found;
- a rule in a template cannot be applied;
- a control character appears inside a template name (spaces and tabs at either end are trimmed);
- this es-python install cannot apply templates.
So a templated run never has less protection than you asked for.
If the EyalSec server gives no usable answer, the ready-made templates still work from a copy es-python carries, and the startup line says so. Your own templates, and those EyalSec published, need the server. Raise is then checked against the last settings the server sent this machine.
ES2_TEMPLATE does the same as the flag, one name per line. Names from ES2_TEMPLATE and from --template are combined, and the run uses each one once. Python programs your program starts are protected by the same templates.
Nothing from a templated run is saved: the next run without --template uses only your dashboard rules. A template only adds protection; it never removes a dashboard rule or switches an input off. Its rules do not count as the machine's own Raise rules, so --raise still applies beside a template while the machine has none.
Examples
A few common combinations.
# Watch network input for one run
es-python --make-socket-vuln server.py
# Watch everything, block on the first finding
es-python --make-everything-vuln --raise app.py
# Block privilege escalation for one run
es-python --template privesc app.py
# Run the test suite with file and stdin watched, sending the environment
ES2_MAKE_FILE_VULN=1 ES2_MAKE_STDIN_VULN=1 es-python --report-env -m pytest
# Watch foreign files, trusting a shared tools directory you maintain
ES2_FOREIGN_CODE_ALLOW=/opt/team-tools es-python --make-foreign-vuln app.py
To run a test suite in a CI pipeline and fail the build on what it finds, see Run es-python in CI.