### Install the Go SDK Source: https://docs.caracal.run/guides/sdk-go Install the Caracal Go SDK using the go get command. ```go go get github.com/garudex-labs/caracal/packages/sdk/go ``` -------------------------------- ### Install Go net/http Connector Source: https://docs.caracal.run/sdks/connectors/nethttp Install the Go net/http connector using the go get command. ```go go get github.com/garudex-labs/caracal/packages/connectors/nethttp/go ``` -------------------------------- ### Open Caracal Console Guided Setup Source: https://docs.caracal.run/get-started This command opens the Caracal Console in your web browser, guiding you through the initial setup process. Ensure the local stack is running. ```bash caracal console ``` -------------------------------- ### Install Go Package Source: https://docs.caracal.run/sdks/revocation Install the revocation package for Go. ```bash go get github.com/garudex-labs/caracal/packages/revocation/go ``` -------------------------------- ### Install caracalai-sdk Source: https://docs.caracal.run/guides/sdk-python Install the Python SDK using pip. ```bash pip install caracalai-sdk ``` -------------------------------- ### Navigate and Configure Bootstrap Example Source: https://docs.caracal.run/examples/control-bootstrap Steps to navigate to the bootstrap example directory, copy environment variables, and configure them. ```bash cd examples/controlBootstrap cp env.example .env $EDITOR .env . .env ``` -------------------------------- ### Install the TypeScript SDK Source: https://docs.caracal.run/guides/sdk-typescript Install the Caracal SDK using npm. ```bash npm install @caracalai/sdk ``` -------------------------------- ### Install Project Dependencies Source: https://docs.caracal.run/contributing/setup Clone the repository and install project dependencies using pnpm. ```bash git clone https://github.com/Garudex-Labs/caracal.git cd caracal pnpm install ``` -------------------------------- ### Initialize and Start Local Development Environment Source: https://docs.caracal.run/operations/docker-compose Use these commands to initialize secrets, start the local development stack, check readiness, and run smoke tests. ```bash pnpm secrets:init caracal up caracal status --ready bash infra/scripts/smokeTest.sh ``` -------------------------------- ### Check Provider Readiness Example Source: https://docs.caracal.run/operations/troubleshooting This example demonstrates how to check the binding between resources and providers, and policy authorization. It's part of gathering diagnostic information for resource-to-provider binding issues. ```bash examples/providerPreflight ``` -------------------------------- ### Install Caracal Console (Linux/macOS) Source: https://docs.caracal.run/get-started/install-caracal Installs the Caracal Console and CLI using a curl script. This is the default installation method for Linux and macOS. ```bash curl -fsSL https://raw.githubusercontent.com/Garudex-Labs/caracal/main/install-console.sh | sh ``` -------------------------------- ### Install Admin Package Source: https://docs.caracal.run/sdks/admin Install the @caracalai/admin package using npm. ```bash npm install @caracalai/admin ``` -------------------------------- ### TOML Configuration Example Source: https://docs.caracal.run/runtime-console/config-file An example TOML configuration file demonstrating how to set zone ID, application ID, TTL, and define credentials and MCP governance mode. ```toml zone_id = "zone_prod" application_id = "app_agent" ttl_seconds = 900 [[credentials]] env = "OPENAI_API_KEY" resource = "resource://openai" credential_type = "provider_token" upstream_prefix = "https://api.openai.com/v1" [[optional_credentials]] env = "CARACAL_MANDATE" resource = "resource://mandate-aware-api" credential_type = "caracal_mandate" on_failure = "warn" [mcp_governance] mode = "block" ``` -------------------------------- ### Install Caracal Console (Windows) Source: https://docs.caracal.run/get-started/install-caracal Installs the Caracal Console and CLI on Windows using a PowerShell script. This method requires PowerShell and downloads the installer script first. ```powershell $installer = "$env:TEMP\install-console.ps1" iwr -UseBasicParsing https://raw.githubusercontent.com/Garudex-Labs/caracal/main/install-console.ps1 -OutFile $installer powershell -ExecutionPolicy Bypass -File $installer ``` -------------------------------- ### Install Caracal and Caracal-Console Source: https://docs.caracal.run/get-started This command installs the necessary Caracal CLI and Console components. Ensure you have a package manager like pip installed. ```bash pip install caracal pip install caracal-console ``` -------------------------------- ### Install Dependencies Source: https://docs.caracal.run/examples/lynx-capital Installs the necessary dependencies for the Lynx Capital project, including the Caracal SDK and provider SDKs. ```bash cd examples/lynxCapital python -m venv .venv source .venv/bin/activate pip install -e . pip install -e _mock/sdk/lynx_sdk_stripe_treasury -e _mock/sdk/lynx_sdk_tax cp .env.example .env ``` -------------------------------- ### Run npm start with caracal Source: https://docs.caracal.run/guides/runtime-run This command starts the `npm start` process within a Caracal runtime environment. The child process will have access to Caracal environment variables for profile lookup, credential exchange, and resource routing. ```bash caracal run -- npm start ``` -------------------------------- ### Start Caracal Source: https://docs.caracal.run/get-started/first-protected-call Starts the Caracal services and checks their readiness. Run this command in your terminal. ```bash caracal up caracal status --ready ``` ```powershell $env:CARACAL_CONFIG = "C:\path\to\caracal.toml" caracal run -- .\start-agent.ps1 ``` -------------------------------- ### Install Postgres Token State Backend Source: https://docs.caracal.run/sdks/connectors/postgres Install the package using npm. The package requires Node.js version 22 or later. ```bash npm install @caracalai/tokenstate-postgres ``` -------------------------------- ### Start Local Provider Fixtures Source: https://docs.caracal.run/examples/lynx-capital Starts the local provider fixtures using Docker Compose. This is required for the application to interact with mock services. ```bash docker compose -f _mock/docker-compose.yml up -d --build --wait ``` -------------------------------- ### Start Local Development Stack Source: https://docs.caracal.run/contributing/setup Initialize secrets and start the local Caracal stack using pnpm commands. Use 'status --ready' to check if the stack is operational. ```bash pnpm secrets:init pnpm caracal up pnpm caracal status --ready ``` -------------------------------- ### Install Caracal TypeScript SDK Source: https://docs.caracal.run/sdks/typescript Install the main TypeScript package for agent lifecycle, delegation, and routing. ```bash npm install @caracalai/sdk ``` -------------------------------- ### Install Express Connector and Dependencies Source: https://docs.caracal.run/sdks/connectors/express Install the necessary npm packages for the Express connector, transport, and revocation store. ```bash npm install @caracalai/mcp-express @caracalai/transport-mcp @caracalai/revocation-redis ``` -------------------------------- ### Install Python Package Source: https://docs.caracal.run/sdks/revocation Install the revocation package for Python using pip. ```bash pip install caracalai-revocation ``` -------------------------------- ### Start Demo Upstream Source: https://docs.caracal.run/get-started/first-protected-call Starts a local Nginx server as a demo upstream service within the Caracal Docker network. This is used as a placeholder for a protected resource. ```bash docker run --rm -d --name caracalDemoUpstream --network caracalData nginx:stable-alpine ``` ```powershell docker run --rm -d --name caracalDemoUpstream --network caracalData nginx:stable-alpine ``` -------------------------------- ### Start Caracal Services Source: https://docs.caracal.run/examples/lynx-capital Starts the Caracal runtime and Console. Use the Console to set up the Lynx zone and register provider resources. ```bash caracal up caracal status --ready caracal-console ``` -------------------------------- ### Install Caracal Connectors for Go Source: https://docs.caracal.run/guides/protect-nethttp Install the necessary Caracal packages for Go net/http integration and revocation. ```go go get github.com/garudex-labs/caracal/packages/connectors/nethttp/go go get github.com/garudex-labs/caracal/packages/revocation/go ``` -------------------------------- ### Start Caracal Runtime and Console Source: https://docs.caracal.run/examples/control-bootstrap Commands to start the Caracal runtime and access the Console. Ensure the runtime is ready before proceeding. ```bash caracal up caracal status --ready caracal console ``` -------------------------------- ### Minimal Helm Installation Source: https://docs.caracal.run/operations/kubernetes-helm Installs or upgrades the Caracal Helm chart with production values. Ensure the namespace is created if it doesn't exist. ```bash helm upgrade --install caracal infra/helm/caracal \ --namespace caracal \ --create-namespace \ --values infra/helm/caracal/values.production.yaml ``` -------------------------------- ### Run Bootstrap Tests Source: https://docs.caracal.run/examples/control-bootstrap Executes the tests for the bootstrap example. Note that these tests use mock transport and do not interact with a live Caracal stack. ```bash cd examples/controlBootstrap npm test ``` -------------------------------- ### Run the Lynx Capital App Source: https://docs.caracal.run/examples/lynx-capital Starts the FastAPI application for Lynx Capital. Access the application via http://localhost:8000. ```bash python -m uvicorn app.main:app --reload --port 8000 ``` -------------------------------- ### Launch Research Agent with Caracal Source: https://docs.caracal.run/examples/research-agent Command to launch the Research Agent example using `caracal run`. Ensure the CARACAL_CONFIG environment variable is set. ```bash cd examples/ResearchAgent export CARACAL_CONFIG="$HOME/.config/caracal/research-agent/caracal.toml" caracal run -- node agent.mjs ``` -------------------------------- ### Open Caracal Console Source: https://docs.caracal.run/get-started/first-protected-call Opens the Caracal interactive console for guided setup of resources and policies. Run this command in your terminal. ```bash caracal console ``` ```powershell caracal console ``` -------------------------------- ### Install Specific Caracal Console Release (Windows) Source: https://docs.caracal.run/get-started/install-caracal Installs a specific version of the Caracal Console and CLI on Windows by providing a version tag to the PowerShell installer. Open a new shell after installation. ```powershell powershell -ExecutionPolicy Bypass -File $installer -Version vYYYY.MM.DD ``` -------------------------------- ### Run Bootstrap Provisioning Source: https://docs.caracal.run/examples/control-bootstrap Executes the bootstrap script to create demo product state. This process is idempotent and will skip existing objects. ```bash npm run bootstrap ``` -------------------------------- ### Verify Caracal Installation Source: https://docs.caracal.run/get-started/install-caracal Checks the installed versions of the Caracal CLI and Console, and displays help for the 'caracal status' command. Run these commands in your shell after installation. ```bash caracal --version caracal-console --version caracal status --help ``` ```powershell caracal --version caracal-console --version caracal status --help ``` -------------------------------- ### Policy Activation Example Source: https://docs.caracal.run/sdks/admin Demonstrates the process of creating a policy, adding it to a policy set, and activating the policy set using the AdminClient. This involves creating a policy, creating a new version of a policy set with the policy, and then activating that version. ```typescript const policy = await admin.policies.create(zoneId, { name: "tickets-read", content: policySource, }); const set = await admin.policySets.create(zoneId, "tickets"); const version = await admin.policySets.addVersion(zoneId, set.id, [ { policy_version_id: policy.version.id }, ]); await admin.policySets.activate(zoneId, set.id, version.id); ``` -------------------------------- ### Initialize and Use Postgres Backend Source: https://docs.caracal.run/sdks/connectors/postgres This snippet shows how to import the necessary components, execute the DDL to create the table, instantiate the `PostgresBackend`, and set a token state entry. It requires a pre-existing PostgreSQL connection pool. ```typescript import { MCP_TOKEN_STATE_DDL, PostgresBackend } from "@caracalai/tokenstate-postgres"; await pool.query(MCP_TOKEN_STATE_DDL); const backend = new PostgresBackend(pool); await backend.set({ zone_id: "zone_prod", sub: "agent_123", scope: "tickets:read", expires_at: new Date(Date.now() + 60_000).toISOString(), }); ``` -------------------------------- ### Install Specific Caracal Console Release (Linux/macOS) Source: https://docs.caracal.run/get-started/install-caracal Installs a specific version of the Caracal Console and CLI by providing a version tag to the installation script. Use this to pin a release. ```bash curl -fsSL https://raw.githubusercontent.com/Garudex-Labs/caracal/main/install-console.sh | \ sh -s -- --version vYYYY.MM.DD ``` -------------------------------- ### Run Provider Preflight Check Source: https://docs.caracal.run/examples/provider-preflight Execute the preflight check by navigating to the `examples/providerPreflight` directory and running the `npm run preflight` command with the necessary environment variables set. Ensure all required variables like `CARACAL_API_URL`, `CARACAL_ADMIN_TOKEN`, `PREFLIGHT_ZONE_ID`, `PREFLIGHT_RESOURCE_ID`, `PREFLIGHT_APPLICATION_ID`, and `PREFLIGHT_SCOPES` are configured. ```bash cd examples/providerPreflight CARACAL_API_URL=http://127.0.0.1:3000 \ CARACAL_ADMIN_TOKEN= \ PREFLIGHT_ZONE_ID= \ PREFLIGHT_RESOURCE_ID= \ PREFLIGHT_APPLICATION_ID= \ PREFLIGHT_SCOPES=pipernet:read,pipernet:write \ npm run preflight ``` -------------------------------- ### Install TypeScript Package Source: https://docs.caracal.run/sdks/revocation Install the revocation package for TypeScript using npm. ```bash npm install @caracalai/revocation ``` -------------------------------- ### Create Admin Client Instance Source: https://docs.caracal.run/sdks/admin Instantiate the AdminClient with necessary authentication tokens and URLs. apiUrl and adminToken are required for API-backed resources, while coordinatorUrl and coordinatorToken are needed for agent and delegation methods. ```typescript import { AdminClient } from "@caracalai/admin"; const admin = new AdminClient({ apiUrl: process.env.CARACAL_API_URL!, coordinatorUrl: process.env.CARACAL_COORDINATOR_URL, adminToken: process.env.CARACAL_ADMIN_TOKEN!, coordinatorToken: process.env.CARACAL_COORDINATOR_TOKEN, }); ``` -------------------------------- ### Build Docs Source: https://docs.caracal.run/contributing/testing Builds the documentation using pnpm. ```bash pnpm --dir docs build ``` -------------------------------- ### Prepare RC Release Source: https://docs.caracal.run/contributing/release Use this command pattern to prepare a release candidate version. Specify the base version and the RC suffix. ```bash scripts/release.sh rc prepare --base-version --suffix rc.1 ``` -------------------------------- ### Install MCP Transport Packages (Python) Source: https://docs.caracal.run/guides/protect-mcp Install the required Caracal transport packages for Python to protect your MCP server. ```bash pip install caracalai-transport-mcp caracalai-revocation ``` -------------------------------- ### Initialize In-memory Revocation Store (Go) Source: https://docs.caracal.run/sdks/revocation Instantiate an in-memory revocation store for local development or testing in Go. Configure default TTL. ```go revocation.NewInMemoryStore(defaultTTL) ``` -------------------------------- ### Install caracalai-mcp-fastmcp and caracalai-revocation Source: https://docs.caracal.run/guides/protect-fastmcp Install the necessary libraries for protecting FastMCP apps and managing revocations. Use caracalai-revocation-redis for production. ```bash pip install "caracalai-mcp-fastmcp[fastmcp]" caracalai-revocation ``` -------------------------------- ### Run Provider Preflight Tests Source: https://docs.caracal.run/examples/provider-preflight Execute the automated tests for the Provider Preflight tool by navigating to the `examples/providerPreflight` directory and running `npm test`. These tests simulate network, DNS, and policy responses without making live system calls. ```bash cd examples/providerPreflight npm test ``` -------------------------------- ### Install MCP Transport Packages (TypeScript) Source: https://docs.caracal.run/guides/protect-mcp Install the necessary Caracal transport packages for TypeScript to enable MCP server protection. ```bash npm install @caracalai/transport-mcp @caracalai/revocation ``` -------------------------------- ### Caracal.from_config(path) Source: https://docs.caracal.run/sdks/python Loads Caracal configuration from a specified Console-generated `caracal.toml` file path. ```APIDOC ## Caracal.from_config(path) ### Description Loads a Console-generated `caracal.toml` configuration file from the specified path. ### Method `Caracal.from_config(path: str)` ### Parameters #### Path Parameters - **path** (str) - Required - The file path to the `caracal.toml` configuration file. ### Request Example ```python from caracalai_sdk import Caracal caracal = Caracal.from_config('path/to/caracal.toml') ``` ### Response Returns a `Caracal` client instance. ``` -------------------------------- ### Install A2A Transport Package Source: https://docs.caracal.run/sdks/transport-a2a Install the A2A transport package using npm. This package requires Node.js version 22 or higher and depends on @caracalai/oauth and @caracalai/sdk. ```bash npm install @caracalai/transport-a2a ```