> For the complete documentation index, see [llms.txt](https://docs.flopsar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flopsar.com/7/administrator-guide/agent.md).

# Agent

The agent is a native JVMTI library attached to a JVM. Each agent opens a single, encrypted TCP connection to the Flopsar server, receives its instrumentation profile, and streams execution stacks, parameters, exceptions, and JVM metrics back.

Attaching the library and passing `app`, `server`, and `key` is covered in [Installation → Agent](/7/administrator-guide/installation/agent.md).

{% hint style="warning" %}
Running the Flopsar agent alongside other instrumenting agents is not recommended. If you run into problems, detach the other agents first.
{% endhint %}

## Agent Tokens

Each monitored application has a 32-byte pre-shared key (PSK). The agent uses it to authenticate the handshake and encrypt the session. Without a matching token the agent cannot connect, and the instance does not appear in the Workstation.

* Generate a token on the server for the application name you will pass as `app=`.
* Configure it on the agent with `key=env:<NAME>`, `key=file:<PATH>`, or (for testing only) `key=hex:<64 hex characters>`. Prefer `env:` or `file:` — command-line arguments are visible in the process list.
* Rotate a token by generating a new one on the server and redeploying it to every agent of that application. Deleting the token on the server prevents any agent still using it from completing a handshake.

Create, copy, and delete tokens in **Administration → Agent Tokens**. See [Agent Tokens](/7/administrator-guide/agent/agent-tokens.md). The server stores them sealed with the master key; see [Cryptography & Key Management](/7/security/cryptography-and-key-management.md).
