Introduction
Silvana Book relies on autonomous off-chain agents to perform sensitive operations such as cryptographic signing. When deployed on Google Cloud, these agents run as secure, scalable services with strict IAM boundaries and protected key storage. The result is a production-grade signing endpoint that integrates cleanly into the broader Silvana Book infrastructure. This guide explains how to deploy and configure such an agent within a Google Cloud environment.Google Cloud provides a secure, scalable, and production-grade runtime for Silvana Book agents. When deployed on Google Cloud, the agent runs inside Cloud Run as a managed container, with private key storage handled by Secret Manager and external access controlled through API Gateway.
- Self-hosted: Full infrastructure control, internal scaling and deployment management.
- Google Cloud: Managed runtime, automatic scaling, built-in secret storage, faster production rollout.
Before You Start
The Silvana Book agents can be obtained from our official repository here.
- Create or modify a Google Cloud project
- Enable billable services
- Assign IAM roles
- Store a private signing key in Secret Manager
Step 1: Authenticate and Prepare the Environment
- Install and authenticate Google Cloud CLI:
- Verify available projects:
Step 2: Create or Select a Google Cloud Project
You can either create a new isolated project for the agent or deploy into an existing one.Create a New Project
- Link billing:
- Set it as active:
Use an Existing Project
- Confirm billing is enabled:
- If billing is disabled, link a billing account before proceeding.
Step 3: Enable Required Services
Google Cloud Agents depend on several managed services. Enable them:- Serverless runtime (Cloud Run)
- Container builds (Cloud Build)
- Image storage (Artifact Registry)
- Secure secret storage (Secret Manager)
- API exposure (API Gateway)
Step 4: Configure IAM Permissions
- Retrieve your project number:
- The default service account follows this format:
- Grant required roles:
- Later steps will require:
roles/secretmanager.secretAccessorroles/run.invoker
Step 5: Create Artifact Registry Repository
Create a Docker repository:Step 6: Secure the Ed25519 Private Key
The Google Cloud Agent requires a base58-encoded 64-byte Ed25519 private key.- Create a secret:
- If it already exists:
- Grant runtime access:
The private key is never hardcoded and never exposed in logs. Cloud Run retrieves it securely at runtime.
Step 7: Deploy the Agent to Cloud Run
- Deploy the agent directly from source. The deployment must explicitly clear any previously set
PRIVATE_KEYenvironment variable before injecting the Secret Manager value.
- Builds the container image via Cloud Build.
- Stores the image in Artifact Registry.
- Deploys a new Cloud Run revision.
- Injects the private key securely from Secret Manager.
- Ensures no plaintext
PRIVATE_KEYvariable remains in runtime.
- Retrieve the Cloud Run URL:
Step 8: Configure API Gateway
- Create an OpenAPI specification that routes requests to Cloud Run and requires an API key.
- Define routes:
GET /healthPOST /signGET /publickey
- Create the API:
- Set configuration:
- Grant invocation permission:
- Deploy gateway:
- Retrieve the gateway hostname:
Step 9: Enable Managed Service and Create API Key
- Retrieve the managed service name:
- Enable it:
- Create an API key restricted to this service:
- Retrieve the API key value:
Step 10: Test the Running Agent
- Run health check:
- Sign request:
Updating the Agent
To release a new version:- Update source code.
- Re-run the
gcloud run deploycommand. - Cloud Run creates a new revision.
- Traffic shifts automatically to the latest revision.
Operational Notes
For improved performance, follow these guidelines:- Separate staging and production environments.
- Rotate the private key by adding a new secret version.
- Monitor scaling limits if signing volume increases.
- Restrict public access if gateway-only invocation is required.
- Check logs with:
Deployment Outcome
Once completed, the Google Cloud Agent operates as:- a serverless Cloud Run backend;
- a cryptographic signing service using secure secret injection;
- an HTTPS endpoint protected by API Gateway;
- a horizontally scalable, revision-based runtime.