Prerequisites
- A machine identity with the Admin role in Agent Vault (to set one up, follow Step 1 of Create sessions with the API and choose Admin in Role)
- An access token for the machine identity, from Step 2 of Create sessions with the API
- A running proxy that the agent’s machine can reach
Create a session with inline services
You can send inline services only through the API, not from the dashboard or the CLI. Call the endpoint that creates a session as the machine identity, and list the inline services inservices. In this example, the session gets one HTTP service for api.github.com with a bearer token, and the agent can send only GET requests to that host:
nameis optional (without a name, the service goes by its first host on the Sessions page and in the session logs)- Credentials, custom header values, and substitution values can’t use variables, so they can’t contain text in double braces, such as
{{GITHUB_TOKEN}} - An MCP server can’t use OAuth, or limit the agent to some of its tools
- A credential can’t use member-provided values
- You can’t change an inline service after you create the session
Combine inline services with an access bundle
To give a session an access bundle as well as inline services, name the access bundle inaccessBundles in the same request. A session can have only one access bundle.
When you create the session, Infisical compares the host patterns of the inline services with each other and with the access bundle’s services, using the same host conflict rules as for the services in one access bundle:
- If two of the services use the same host pattern, creating the session fails
- If an inline service and a service in the access bundle cover the same host with different patterns, such as
api.github.comand*.github.com, requests to that host use the service with the more specific pattern
Find a session’s inline services
To see a session’s inline services, go to Sessions in Agent Vault, select View Session Logs on the session’s row, and look under Inline Services. The endpoint that reads a session and the endpoint that lists sessions return the inline services inservices, and the audit event for creating the session lists them too.
When the session ends
Infisical deletes the inline services’ credentials, custom header values, and substitution values once the session ends:- If someone revokes the session, Infisical deletes the values right away
- If the session expires, Infisical deletes the values within an hour
ttl to never, revoke the session when the agent finishes, so that Infisical deletes the values. Infisical keeps the rest of each inline service, such as its name and hosts, so you can still find the session’s inline services after the session ends.
Troubleshooting
Creating the session fails with "Only an Agent Vault admin can send services with a session"
Creating the session fails with "Only an Agent Vault admin can send services with a session"
The machine identity has the Member role in Agent Vault. Either give it the Admin role, or add the services to an access bundle and grant the bundle to the machine identity.To give the machine identity the Admin role:
1
In Agent Vault, go to Access Control > Machine Identities.
2
Open the machine identity’s menu and select Change Role.
3
Choose Admin in Product Role, then select Save.
Requests to an inline service's host stop getting credentials
Requests to an inline service's host stop getting credentials
The user or machine identity that created the session no longer has the Admin role in Agent Vault. Give the role back, or create a new session as an admin.
Next steps
Session logs
Record every request an agent makes during a session.
HTTP APIs
Limit an HTTP service’s methods and paths, and add custom headers and substitutions.