Concept · access
Use when
A command is refused or held, a read comes back smaller than expected, or you must say who you act as.
For
Every call acts as one credential. There are three kinds.- Session. A person who signed in with
penumbra login. A session acts as that person with their project role. Nothing it does waits for approval. - Key. A project API key. It reaches one project, holds the scopes its
creator chose, and is sent as
PENUMBRA_TOKEN. - Connection. An agent that a person approved with
penumbra connector on the connect page. It is “my assistant, as me”: it acts for that person, with the scopes the person chose, never above their role.
Use when
- A command was refused, or held for approval, and you need to know why.
- You read less than the person says is there.
- The person asks who you act as, or what you may do.
- You plan work for a key or agent, and some of it needs a person’s session.
Not this
- A change that returned
pending: follow it (card Approval). - Which project a command runs in: card Project.
- Building the part of the project a client may read: card View.
Rules
credential.1Name your credential before you plan around it. Your job: runpenumbra whoami. It prints the kind:session,keyorconnection. It prints where the CLI took it from, the project and the expiry. For a key it prints only the last four characters. It prints neither your role nor a View.credential.2The CLI picks one credential in this order:--token, thenPENUMBRA_TOKEN, then the profile’s stored login or connection. Your job: when you act as the wrong party, read the source line ofpenumbra whoami. A key left inPENUMBRA_TOKENhides a stored login.credential.3Three commands answer three questions. Your job: runpenumbra statusfor your role and for each command group that your credential limits. Runpenumbra access mefor the View that limits you. Runpenumbra status --explain "<command>"for one command. The status command does not show a View, andpenumbra access medoes not show a role. For a View command such aspenumbra context slice publish,penumbra status --explainreports neither a missing scope nor a wait for approval.credential.4Some work needs a person’s own session. Enforced: a key or connection that manages keys, access or Brains is refused withhuman_session_required. Your job: runpenumbra status --explain "<command>"first. It says that a session is needed for commands on access, Brains and Kits. It does not say so for commands on keys.credential.5A key holds the scopes given when it was created, and its secret is shown once. Enforced: a call that needs a scope the key lacks is refused with “This API key does not have the<scope>scope”. The text also names the command that makes a key with it. Your job: keep the secret out of logs and files. A lost secret cannot be read again, so revoke the key and make a new one. To get a scope the key lacks, make another key with every scope you need. A door that cannot name the scope can still refuse with “This API key is not active”. Read the key’s scopes inpenumbra keys listbefore you decide that it was revoked.credential.6A connection never holds more than its person. Enforced: a scope above the person’s role is refused withscope_above_role. A viewer may grant read scopes only. An editor may add the write scopes an editor uses. Owners and admins have no cap. Removing the person, or lowering their role, revokes the connection.credential.7A person’s View limit follows the person’s agents. Enforced: a connection that a limited client approved reads through the client’s View, live. Changing or retiring the View changes the connection at once, and a write scope for it is refused withview_bounded_read_only.credential.8A client’s access cannot be passed on. Enforced: a client is a project viewer, and creating a key needs an organization owner or admin, so the cell refuses a client who tries. A connection that a client approves has no secret to copy, and it works only through that client’s own approval. Your job: never give a client’s session token to another tool or agent.penumbra auth tokenprints the token of the session you hold.credential.9A key or an agent can be limited to a View when it is created. Enforced: it must hold read scopes only, or the creation is refused withview_requires_read_only, and nothing is created. Your job: usepenumbra keys createorpenumbra kits connections createwith--view, so the key never reads the whole project.
Failure signs
- A command exits with code 4 and prints
pending: problem change-waits-for-approval. - A read is not found, though the person says it exists, and you may be limited to a View: problem hidden-reads-as-missing.
- You cannot tell what you may see: problem what-can-this-credential-see.
- A key is refused as “not active”, and it is not revoked: rule credential.5.
- A command says it needs a person’s session: rule credential.4.
Doors
HTTP reference
- Get caller
- List accessible projects
- List projects
- Get project connections
- Get caller access
- List approvals
- Get approval