Skip to main content

Configuration reference

Complete reference for the Hosted Agent's environment variables, install command parameters, execution limits, and status lifecycle.

A note on naming: in configuration names, broker refers to the agent itself and manager refers to the APIsec platform. The BROKER_* variables configure the agent; MANAGER_HOST_URL and PROXY_MANAGER concern its connection to the platform.

Environment variables​

The generated install command sets the variables an agent needs. Values marked "install command" are what the generated docker run sets; the default applies when the variable is absent.

VariableDefaultDescription
MICRONAUT_ENVIRONMENTS— (install command: broker)Selects broker mode, the production mode: no HTTP server, outbound polling only. Required for customer deployments.
MANAGER_HOST_URLInternal development value (install command: https://<platform-host>/v1)Base URL of the APIsec platform endpoint the agent calls. Always use the value from the generated install command.
BROKER_IDRequiredThe agent's ID (UUID), assigned when the agent is created.
BROKER_TOKENEmptyThe agent's broker token (JWT). Sent as a bearer token on every platform call. Treat it as a credential.
BROKER_NAMEhosted-brokerDisplay name reported in status.
BROKER_TYPEhosted (install command: DOCKER_LINUX or DOCKER_WINDOWS)Deployment type reported in status.
BROKER_VERSIONv3.1Version string reported in status. Display-only — see Upgrading and versions.
SEND_BACK_ERROR_REPORTfalse (install command: true)When true, error reports sent to the platform include stack traces.
HEARTBEAT_SCHEDULED_INITIAL30s (install command: 0m)Delay before the first instruction poll after startup.
HEARTBEAT_SCHEDULED_FIXED30s (install command: 5s)Interval between instruction-poll cycles when idle.
HEARTBEAT_REPORT_HEALTH_FIXED5mInterval for the ACTIVE health heartbeat.
HEARTBEAT_EAGER_POLL_DURATION_MS10000After receiving work, the agent keeps fast-polling for this many milliseconds so bursts of instructions drain without waiting for the idle interval.
HEARTBEAT_EAGER_POLL_INTERVAL_MS1000Poll interval, in milliseconds, during the fast-poll window.
ENABLE_CERTIFICATESfalseEnables mTLS and custom-CA support for target API calls. See Certificates and mTLS.
CERTIFICATES_BASE_PATH/app/certificates/Container directory holding config.json and certificate files.
PROXY_MANAGERfalseRoutes agent-to-platform traffic through a proxy. Target API calls are never proxied. See Proxy configuration.
PROXY_TYPEEmptyHTTP or SOCKS. Required when PROXY_MANAGER=true.
PROXY_HOSTEmptyProxy hostname. Required when PROXY_MANAGER=true.
PROXY_PORT0Proxy port. Must be greater than 0 when PROXY_MANAGER=true.
PROXY_USERNAMEEmptyOptional proxy username.
PROXY_PASSWORDEmptyOptional proxy password.
note

Despite the shared prefix, the HEARTBEAT_SCHEDULED_* and HEARTBEAT_EAGER_POLL_* variables control instruction polling. Only HEARTBEAT_REPORT_HEALTH_FIXED controls the health heartbeat that keeps an agent ACTIVE in the console.

Configuration properties without a dedicated variable​

PropertyDefaultDescription
execution.parallel.threads10 (minimum 1)Parallel HTTP worker threads per scan batch. The agent's connection pool is sized to match. The install command does not set this property, and no dedicated environment variable is defined for it.

Install command parameters​

The generated install command runs the container as:

docker run -d --name "apisechostedagent-<agent-id>" --restart=unless-stopped --cpus=1 --memory=2g \
-v "apisec-agent-data-<agent-id>:/tmp" \
-e ... <environment variables listed above> \
<agent-image>
ParameterValuePurpose
--nameapisechostedagent-<agent-id>Stable container name per agent.
--restartunless-stoppedDocker restarts the container after crashes and after platform-initiated restarts.
--cpus / --memory1 / 2gResource caps per container.
-vapisec-agent-data-<agent-id>:/tmpNamed volume. Persists the restart marker so a platform-initiated restart is recognized on the next startup.

Platform connection and retry​

VariableDefaultPurpose
SCANSERVICE_CONNECT_TIMEOUT5sConnect timeout for calls to the APIsec platform.
SCANSERVICE_READ_TIMEOUT30sRead timeout for calls to the APIsec platform.
HEARTBEAT_POLL_RETRY_MAX_ATTEMPTS3Attempts before a failed instruction poll is given up.
HEARTBEAT_POLL_RETRY_INITIAL_DELAY_MS500Delay before the first poll retry.
HEARTBEAT_POLL_RETRY_MULTIPLIER2.0Backoff multiplier between poll retries.

Request execution​

Redirect handling:

  • Redirects are followed only within the original host. A redirect to a different host is refused. A leading www. is ignored when comparing hosts.
  • Circular redirects are refused, and the number of redirects per request is bounded.
  • A scan instruction can disable redirect-following for an individual request.

Supported HTTP methods against targets: GET, POST, PUT, DELETE, OPTIONS, HEAD, TRACE, PATCH.

Agent status lifecycle​

StatusMeaningSet when
PROVISIONEDCreated, not yet reportingOn agent creation, and again after a token rotation.
ACTIVEAgent is registered and heartbeatingReported by the agent at container startup and on every health heartbeat (default: every 5 minutes).
UNRESPONSIVEHeartbeats have gone staleApplied by the platform to an ACTIVE agent whose last heartbeat is at least 1 hour old. Evaluated when the agent list is read, so the transition can lag.
SHUTDOWNAgent stopped gracefullyReported by the agent on graceful stop, including a platform-initiated restart.
DELETEDAgent removedOn deletion from the console. An ACTIVE agent cannot be deleted; deletion revokes the agent's token immediately.

Container internals​

  • Base image: apisec/java:17.0.20 (Java 17).
  • JVM arguments baked into the image: -Xmx2g -Xms2g -Xss512m.
note

Supported CPU architectures for the published image are not documented here. If you need a specific architecture (for example, arm64), confirm with APIsec support.