Prerequisites
- A machine identity with the Admin role in an Agent Vault project
- An access token for the machine identity, from the Universal Auth Login endpoint, or an SDK client logged in as the machine identity (Python or Node.js)
- A running proxy in the same project, which the agent’s machine can reach
Create a session with inline services
Create a session as the machine identity, with your Agent Vault project ID and 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:
Inline service fields
An inline service has the same fields as a service in the project, with the following differences:nameis optional for HTTP APIs and MCP servers (without one, the service goes by its first host on the Sessions page and in the session logs)nameis required for a database or SSH server, because the agent connects to it by name- 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 OAuth credential can’t start a sign-in, so it names an OAuth variable or carries tokens you already have (see Use OAuth in an inline service)
- A credential can’t use member-provided values
- You can’t change an inline service after you create the session
Limits
- A session can have up to 30 inline services
- No two of a session’s services can have the same name (a service without a name counts as its first host)
Use OAuth in an inline service
An HTTP API or MCP server sent with a session can use OAuth in one of two ways. Either way, the proxy sends the access token asAuthorization: Bearer <access-token>.
To use a sign-in stored in Infisical, name an OAuth variable of the project in variable:
clientSecret if your OAuth app has none. If the provider rotates refresh tokens, the refresh token you sent stops working once Infisical renews the access token.
Combine with services in the project
To give a session an access bundle as well as inline services, name the access bundle inaccessBundle in the same request. A session can have only one access bundle.
To add other services from the project, put their names in services next to the inline services, such as "services": ["linear", {"type": "http", ...}].
When you create the session, Infisical checks its services for host conflicts, the same 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 from the project 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 your Agent Vault project, select View Session Logs on the session’s row, and look under Inline Services. The Access column on the Sessions page also shows how many inline services a session has. Hover over the count to see their names and hosts.
services, and the audit event for creating the session lists them too.
Credential deletion
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 "You are not allowed to create-with-inline-services on agent-vault-sessions"
Creating the session fails with "You are not allowed to create-with-inline-services on agent-vault-sessions"
The machine identity has the Member role in the Agent Vault project. Either give it the Admin role, or add the services to an access bundle, grant the bundle to the machine identity, and name the access bundle or the services instead.To give the machine identity the Admin role:
1
In your Agent Vault project, 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 the Agent Vault project. 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.