When enterprises integrate AI Agents into business processes, the Agents must access LLM services securely. In the traditional model, scattered management of API keys can lead to leaks and misuse. Outbound authorization for LLM in Agent ID Guard centralizes API key custody and distributes keys on demand to keep credentials secure.
Overview
As AI Agents become widely used, they must securely access multiple external services: LLM services, third-party Software as a Service (SaaS) applications, and internal enterprise services. Authorization management for LLM nodes is one of the core capabilities of Agent ID Guard. Designed for LLM services, it uses centralized custody and dynamic authorization to manage LLM API keys securely and precisely:
Centralized encrypted custody: API keys are stored in the Agent ID Guard credential service and encrypted by Alibaba Cloud Key Management Service (KMS). This eliminates the risk of scattered plaintext keys.
Dynamic issuance at runtime: Agents use their identity credentials to retrieve API keys in real time on demand, without preset keys in images or configurations. This reduces leak risks at the source.
Least-privilege authorization: Outbound authorization relationships are built on Agent identity, so each Agent can access only the specific API keys that its business requires. This follows the principle of least privilege.
Core concepts
Concept | Description |
Agent node | A machine identity hosted by Agent ID Guard. It maps to an underlying M2M (Machine-to-Machine) application. |
LLM node | An outbound node in the Agent workflow. Each LLM node is associated with one API key credential, which is hosted in the Agent ID Guard credential service and encrypted with KMS. |
Credential identifier | The unique identifier of an API key credential. An Agent uses the credential identifier to retrieve the corresponding API key without accessing the original API key plaintext. |
Outbound authorization | The authorization relationship between an Agent node and an LLM node, covering both function authorization and data authorization. Only Agents with an established outbound authorization can retrieve the API key of that LLM. |
Function authorization | Controls what operations an Agent can perform. Function authorization is granted automatically when the Agent is registered, giving it permission to retrieve credentials. |
Data authorization | Controls which specific credential an Agent can retrieve. It is defined as a rule in the format "associated identity + authorized asset". When an Agent is registered, the system creates an authorization rule for that Agent. After an LLM node is added, the API key credential is automatically included in the rule, which grants the Agent permission to retrieve that API key credential. |
API key credential management
Outbound authorization for LLM API keys is tightly integrated with credential management:
When you add a node:
The LLM API key is stored in the Agent ID Guard credential service and protected by KMS encryption. When the API key is stored in KMS, it is encrypted into ciphertext with an industry-standard encryption algorithm and protected by a dedicated hardware security module.
The system automatically adds the credential to the Agent-specific authorization rule, and the authorization takes effect immediately.
When you delete a node: The system automatically removes the credential from the Agent-specific authorization rule and immediately revokes access permissions. The credential itself is not deleted and remains available for other Agents.
When you rotate an API key: The administrator updates the API key value in the credential service. All associated Agents automatically get the new API key at the next retrieval, with no need to notify or redeploy Agents individually.
Prerequisites
An IDaaS EIAM Enterprise Edition instance is created with machine identity management enabled.
The Agent identity is registered in Agent ID Guard. For more information, see Agent identity registration and authentication configuration guide.
An API key issued by the LLM service provider, such as a Model Studio API key, is obtained.
Procedure
Step 1: Add an LLM node
Log on to the IDaaS EIAM console.
Click Agent Identity Security, and then go to the Agent ID Guard list page.
Select the target Agent. In the Operation column, click Edit. Go to the Agent details page, and click the Agent module in the flowchart at the bottom of the page.
Confirm that the Agent identity is registered (a green checkmark icon appears to the right of the Agent module name). You can add an LLM node only after the registration is complete.
In the upper-right corner of the topology diagram, click Add Node, and then select Large Language Model (LLM) from the pop-up menu.
NoteEach LLM node corresponds to one API key credential. If an Agent needs to access multiple LLM services, such as Qwen and OpenAI, add a separate LLM node for each service.
Configure the Large Language Model (LLM) node. Choose one of the following methods based on your business requirements:
Add an API key credential
Use this method if the required credential does not exist in the API key credential list:
Click Add API Key Credential.
Configure the following parameters:
Parameter
Description
Example
Credential Name
The name displayed in the console.
Qwen production environment key
Description
The purpose of this credential.
Qwen LLM API key, used only in the production environment
API key ID
The unique identifier of the credential. An Agent uses this identifier to retrieve the API key plaintext.
qwen-apikey-prod
API Key
The plaintext of the LLM API key. After you enter the key, it is encrypted and stored with KMS.
sk-xxxxx
After you complete the configuration, click OK to create the credential.
Select an existing API key credential
Use this method if the required credential already exists in the API key credential list, for example, if another Agent has added the same API key credential. Select the credential directly from the list.
Step 2: Outbound authorization (automatic)
After the credential is selected or created, the system automatically adds it to the Agent-specific authorization rule. No manual configuration is required.
After the process is complete, verify the authorization in the topology diagram:
An outbound authorization connection appears between the Agent node and the LLM node, which indicates that the authorization is established.
Click the connection to view the authorization details, including the associated credential identifier and status.
To revoke an Agent's access to an LLM, delete the corresponding LLM node. The system automatically removes the credential from the Agent-specific authorization rule. The credential itself is not deleted and does not affect other Agents.