Academy → Developer guideOfficial documentation · clear explanation

Egress proxy internals

Egress proxy internals

Developer18 minutes3 questions2026-08-09
The idea in one minute

Start with meaning, then move to detail.

This lesson explains Egress proxy internals as part of Hermes internals and extension points. You will learn what it does, when it matters, and the smallest safe test that proves it works.

If you are new

If you are new, do not memorize names. Focus on three questions: what problem does this solve, what access does it need, and how can you verify the result?

For hands-on use

For practice, inspect the first example, identify its effects, run it on test data, and compare the result with the source claim.

For specialists

For advanced readers, inspect Module layout, Lifecycle, Security invariants, then verify failure modes and version compatibility.

What do you need first?

Know Python, Git, and basic project structure before changing code.

What will you know?

A clear outcome before you read.

  • Understand Egress proxy internals without assumed prior knowledge.
  • Separate the source description from what still needs testing in your environment.
  • Read the first command and identify its inputs and outputs before copying it.
Lesson terms

Short definitions before the details.

Approval & sandbox
Approval pauses a sensitive action before execution; sandboxing limits impact if something goes wrong.
Official page description

How the iron-proxy egress firewall integrates with Hermes — module layout, lifecycle, security invariants, and extension points

Topic map

What does the source say, and in what order?

  1. 01
    Module layout

    Start here to understand the core idea or structure.

  2. 02
    Lifecycle

    Read this after the foundation, then connect it to the previous step.

  3. 03
    Security invariants

    Read this after the foundation, then connect it to the previous step.

  4. 04
    Filesystem perms

    Read this after the foundation, then connect it to the previous step.

  5. 05
    Subprocess env minimisation

    Read this after the foundation, then connect it to the previous step.

  6. 06
    Bind policy

    Read this after the foundation, then connect it to the previous step.

  7. 07
    Metrics port collision

    Read this after the foundation, then connect it to the previous step.

  8. 08
    Default deny CIDRs

    Read this after the foundation, then connect it to the previous step.

  9. 09
    Audit log fail-loud

    Read this after the foundation, then connect it to the previous step.

  10. 10
    Bitwarden mode fail-loud

    Finish here to verify the result and special cases.

Examples from the official page

Copy only after you understand the effect.

agent/proxy_sources/iron_proxy.py Core: binary install, CA gen, config build, subprocess lifecycle, mappings I/O, PID/nonce defense. Pure-function surface where possible. hermes_cli/proxy_cli.py Wizard + slash command handlers. `hermes egress {install,setup,start,stop, status,disable,config}`. Wires the core module into argparse. hermes_cli/main.py:_dispatch_egress Top-level sub
hermes egress install -> agent.proxy_sources.iron_proxy.install_iron_proxy(force=...) Downloads pinned tarball + checksums.txt from GitHub Releases. SHA-256 verification before extraction. tarfile.extract(..., filter="data") on Python 3.12+ (PEP 706); falls back to plain extract on older Python with member-name sanitisation via _pick_tar_member. Stage into ~/.hermes/bin/.iron-proxy_XXXX, chmod 755, os.replace to ~/.hermes/bin/iron-proxy (atomic). _VERSION_CACHE.pop(target) so a forced reinstall re-probes --version on next
Also update `_DEFAULT_ALLOWED_HOSTS` so the proxy allows the upstream by default. Run `test_discover_provider_mappings_*` to confirm. ### Adding a new header-token provider (x-api-key family) If the provider authenticates with a static NON-Authorization header (like Anthropic's `x-api-key`, Azure's `api-key`, or Gemini's `x-goog-api-key`), add it to `_HEADER_AUTH_PROVIDERS` — iron-proxy's `secrets.replace.match_headers` targets arbitrary header names, so these are first-class swapped providers:
Try it now

Read the first command and identify its inputs and outputs before copying it.

Match every command to your installed Hermes version, review the files and accounts it can reach, and use non-sensitive data for the first test. If this explanation differs from the source, the official source wins.

Knowledge check

Three decisions before completion.

1. What is the source of truth when “Egress proxy internals” changes?
2. What is the best way to apply this lesson?
3. What should happen before a step can modify files or an external account?