Skip to main content

Module policy

Module policy 

Source
Expand description

The AWS grants a host shares with its container agents (~/.agentmux/aws-grants.json). Spec: docs/specs/SPEC_CONTAINER_AGENT_AWS_CREDENTIALS_2026_10_31.md §6.

Closed by default: no file, no grants. A file that does not parse is an error naming the line, and the version that last parsed stays in force until it is fixed.

Structs§

CallerTag
One session tag the caller supplies on each mint, under a key the grant fixes. A grant for a role whose own policy builds what it may reach from a tag takes the tag’s value from the caller, so the value is checked here: it starts with the prefix the grant fixes, and holds only letters, digits and _.:/=+-@, at most 256 characters.
Grant
Policy

Enums§

Hold
Why a grant in the file is not honoured yet (record): it is new or wider than what was last allowed.
Mint
How srv gets the credentials (spec §7).
Tier

Constants§

AUDIT_ACTION
The audit action of a change to the grants file, and of an answer to a held grant.
FILE_ENV
The environment variable that points at another policy file (tests, an isolated instance).
MAX_SECONDS
MIN_SECONDS
STS refuses a session shorter than 15 minutes, and the roles AgentMux fleets use allow at most an hour.
TAG_VALUE_MAX
The most characters a caller-supplied session tag value, and a tag key, may have.

Functions§

current
The policy now in force. Ok(None): no file, nothing shared. Err: the file does not parse and no earlier version exists.
decide
Answers a held grant: allows it or refuses it, with the reason, by an agent or a person, and puts that in the record and the Audit view. The grant works (or stays refused) from the next request.
file_path
The policy file’s path: the override in FILE_ENV, else aws-grants.json in the AgentMux root.
is_grant_name
A grant’s name: what the container’s profile is called.
view
The grants as the record has them, with what changed lately: when each was added and by which change.