Supporting Services

This chapter covers the services and tools that support your agent workflow β€” container image storage (vCR), LLM model access (AIP), the Python SDK, and security best practices. These are not core AgentBase modules, but you will need them to build and deploy agents.


Container Registry (vCR)

  • Portal: https://vcr.console.vngcloud.vn

  • API Base URL: https://vcr.api.vngcloud.vn

  • Registry Host: vcr.vngcloud.vn

Note: vCR pagination is 1-indexed (page=1 is first page). Image paths use the repository's backendName (not the display name): vcr.vngcloud.vn/{backendName}/{imageName}:{tag}


Create a Repository

Portal (GUI)

  1. Open https://vcr.console.vngcloud.vn β†’ "Create Repository"

  2. Fill in:

    • Repository Name: e.g., my-first-agent (unique, lowercase, alphanumeric and hyphens)

    • Access: Private (recommended)

    • Quota Limit: e.g., 10 GB

  3. Click Create

  4. Note the backendName from the repository detail β€” use this in image paths

RESTful API

Prerequisite: All API examples below use $TOKEN β€” an IAM bearer token. See Configure Authentication for how to obtain it.

Response includes backendName β€” use this in Docker image paths.


Create a Robot Account

Robot accounts are service accounts for Docker push/pull access.

Portal (GUI)

  1. On the repository detail page β†’ "Robot Accounts" β†’ "Create Robot Account"

  2. Fill in: Name, Duration (days), Permissions (push + pull)

  3. Click Create

  4. Immediately copy the Secret Key β€” shown only once

  5. The full username (backendName) has format: {prefix}-{chosen-name} (e.g., 109072-deploy-bot)

RESTful API

Response includes secretKey β€” save it immediately, cannot be retrieved again.


Push & Pull Images

Use in Runtime (runtime creation):


Manage Images

List images:

Delete image:

Delete repository:

Important: You MUST delete all images before deleting the repository.


Known API Quirks

Issue
Workaround

name= is required for list images

Always include ?name= even if empty

Pagination is 1-based

Use page=1 β€” page=0 returns 400

Repo deletion fails if images exist

Delete all images first, then delete repo


Troubleshooting

Error
Cause
Fix

Docker push denied

Robot account lacks push permission

Re-create with explicit push+pull permissions

Docker login fails

Wrong username format

Use full backendName (e.g., 109072-deploy-bot)

Repo deletion fails

Images still exist

Delete all images first

400 on image list

Missing name= param

Always include ?name= even if empty


AI Platform (AIP) β€” LLM Access

  • Portal: https://aiplatform.console.vngcloud.vn/models

  • Management API: https://aiplatform-hcm.api.vngcloud.vn

  • LLM Endpoint: https://maas-llm-aiplatform-hcm.api.vngcloud.vn/v1 (OpenAI-compatible)

Note: AIP uses 1-indexed pagination (page=1). API key names must be ^[a-z0-9\-]{5,50}$.


Browse Models

Portal (GUI)

  1. Open https://aiplatform.console.vngcloud.vn/models

  2. Browse available models β€” click a model to see its path (used as the model parameter in API calls)

RESTful API

Important: Use the path field (not code) as the model parameter when calling the LLM endpoint.


Create an API Key

Note: API key creation is async β€” poll until status is ACTIVE.

Portal (GUI)

  1. Open https://aiplatform.console.vngcloud.vn/models β†’ "API Keys" β†’ "Create API Key"

  2. Enter a Name (5–50 lowercase chars/digits/hyphens) β†’ Create

  3. Wait for status ACTIVE β†’ copy the key value

RESTful API


Call LLM Models

Python (OpenAI SDK):

curl:


Troubleshooting

Error
Cause
Fix

401 on LLM call

Invalid or expired AIP key

Check key status, create new key if needed

Model not found

Wrong model parameter

Use path field from model detail, not code

API key quota full

Too many keys

Delete unused key, then create new one


SDK & Integration

Installation


Authentication Setup

The SDK reads credentials in this priority order:

  1. Environment variables (highest priority):

  1. .greennode.json in the current working directory (fallback):

On AgentBase Runtime: GREENNODE_CLIENT_ID, GREENNODE_CLIENT_SECRET, and GREENNODE_AGENT_IDENTITY are automatically injected by the runtime.


Building an Agent with GreenNodeAgentBaseApp

GreenNodeAgentBaseApp is the SDK's built-in web server. It handles port binding, health check routing, and request dispatch.

RequestContext fields:

Field
Maps to Header
Description

context.user_id

X-GreenNode-AgentBase-User-Id

End-user identifier (for Memory actor_id)

context.session_id

X-GreenNode-AgentBase-Session-Id

Session identifier (for LangGraph thread_id)


Credential Injection Decorators


Identity Client (IdentityClient)


Memory Client (MemoryClient)


LangGraph Integration (AgentBaseMemoryEvents)

For the complete pattern (short-term + long-term memory in a single agent), see Memory Β§ 6.10.


Security Best Practices

IAM Permissions

All AgentBase operations require a GreenNode IAM service account. See Getting Started for setup steps.

Recommended policies:

Policy
Description
Typical User

AgentBaseFullAccess

Full access to Identity, Runtime, and Memory services

Developers, platform team

vcrFullAccess

Full access to Container Registry

Build pipelines, developers

AiPlatformFullAccess

Access to AI Platform LLM models and API keys

Developers, agents

Principle of least privilege:

  • Use service accounts over personal accounts β€” never use personal API keys in CI/CD

  • Separate service accounts per environment (dev/prod)

  • Rotate keys regularly

  • Never share service account credentials

Auto-injected credentials on Runtime (no manual setup needed):

Variable
Description

GREENNODE_CLIENT_ID

IAM service account client ID

GREENNODE_CLIENT_SECRET

IAM service account client secret

GREENNODE_AGENT_IDENTITY

Agent identity name


Credential Management

Secrets lifecycle:


Developer Workstation Security

Gitignore rules for AgentBase projects:

Credential storage guide:

Credential Type
Where to Store
NOT Here

IAM client_id/client_secret

Env vars or .greennode.json

Dockerfile, source code, git

LLM API key (AIP)

.env (local dev) or Access Control (production)

Dockerfile, source code, git

vCR robot account password

GREENNODE_VCR_PASSWORD env var (CI)

Source code, git

External API keys (OpenAI, etc.)

AgentBase Access Control as auth providers

Anywhere in code or config

Pre-commit hook to prevent secret commits:


Credential Rotation

Rotate a static API key (takes effect on next request):

Reset IAM service account credentials:

  1. Go to https://iam.console.vngcloud.vn/service-accounts

  2. Click the service account β†’ "Security credentials" tab β†’ "Reset"

  3. Copy the new client secret (shown only once)

  4. Update GREENNODE_CLIENT_SECRET in your environment

Reset runtime service account (if runtime credentials are compromised):

Warning: This regenerates credentials for the runtime β€” the container will restart with new credentials.


Last updated