Skip to main content


mondoo agents generate-token

generates a registration token to register new agents for your space


Generates a registration token that you can use to register your agent with Mondoo Cloud. A registration token allows a new agent to sign up with your Mondoo space. The new agent will exchange the registration token with a private key for further communication.

The registration token is short lived and is valid for 60 seconds. The expired time can be extended if required. If a registration token expires then you can’t register more agents with Mondoo Cloud by using that specific token. You simply create a new one.

NOTE: By default, agents do not have the permission to generate tokens for new agents. You'll need to elevate permissions to Gateway Agent via the Mondoo Console.

Generates a new registration token that is valid for 60 seconds:

$ mondoo agents generate-token

Generates a new registration token that is valid for 120 seconds:

$ mondoo agents generate-token --expiresin 120

Pipe the token into a file:

$ mondoo agents generate-token --expiresin 120 > registrationtoken.txt
mondoo agents generate-token [flags]


      --description string   optional description for the token
--expiresin int duration in seconds that the registration token is valid (default 60)
-h, --help help for generate-token

Options inherited from parent commands

      --config string      config file (default is $HOME/.config/mondoo/mondoo.yml)
--log-level string set log-level: error, warn, info, debug, trace (default "info")
-v, --verbose verbose output