# ============================================================================= # COGNIVERN ENVIRONMENT CONFIGURATION # ============================================================================= # Copy this file to .env and fill in your values # NEVER commit .env to git - it's in .gitignore # ============================================================================= # ----------------------------------------------------------------------------- # Server Configuration # ----------------------------------------------------------------------------- NODE_ENV=development PORT=3001 LOG_LEVEL=info AGENTS_ENABLED=false # ----------------------------------------------------------------------------- # API Security # ----------------------------------------------------------------------------- # External callers authenticate with workspace-scoped cvn_ keys (created in # Settings → API keys) or JWT. The global COGNIVERN_API_KEY was retired. # Optional: backend-internal HTTP callers (agents, copilot) use this scoped key. COGNIVERN_SERVICE_API_KEY= JWT_SECRET=your_jwt_secret_here # Same secret is required by Next.js OS routes (/api/os/hydra, /api/os/intent) # to verify session JWTs. Set it on Vercel as well as the API host. # CORS - comma-separated list of allowed origins CORS_ORIGIN=http://localhost:3000,https://cognivern.persidian.com # Optional extra SIWE domains (host[:port]), used in addition to CORS_ORIGIN. # SIWE_ALLOWED_DOMAINS=localhost:3000,cognivern.persidian.com # Frontend build-time API origin. In production this should be the API host; # browser requests remain same-origin through the Next/Vercel /api rewrite. NEXT_PUBLIC_API_URL=http://localhost:3001 # ----------------------------------------------------------------------------- # Self-call base URL — used by internal agents to route their own actions # through Cognivern's governance pipeline. In dev, leave at default. In prod, # set to the deployed API URL. # ----------------------------------------------------------------------------- COGNIVERN_SELF_BASE_URL=http://localhost:3001 # ----------------------------------------------------------------------------- # Human confirmation token for spends at or above the policy threshold. If # unset, those spends are held (no execution) and surfaced via audit. # In production, the operator UI issues short-lived tokens per held spend. # ----------------------------------------------------------------------------- COGNIVERN_HUMAN_CONFIRM_TOKEN= # ----------------------------------------------------------------------------- # Source-aware spend authorization (prompt-injection controls) # ----------------------------------------------------------------------------- # Stable HMAC key for short-lived, operator-issued spend authorizations. Required # in multi-process or restart-surviving production deployments. SPEND_AUTHORIZATION_SECRET= # Set true after agent integrations attach source provenance to every spend. # Every spend then requires an operator-issued source authorization. SOURCE_AWARE_SPEND_ENFORCEMENT=false # ----------------------------------------------------------------------------- # Connector egress policy # ----------------------------------------------------------------------------- # Enable destination and payload enforcement for webhook, Slack, and MCP POSTs. EGRESS_POLICY_ENFORCEMENT=false # Comma-separated hostnames, e.g. alerts.example.com, hooks.slack.com COGNIVERN_EGRESS_ALLOWLIST= # ----------------------------------------------------------------------------- # Filecoin / FVM (Governance + Audit Anchoring, optional) # ----------------------------------------------------------------------------- # FILECOIN_PRIVATE_KEY is also used as a shared EVM signing key by # AuditLogService (evidence signing) and FhenixPolicyService (fallback). # In production, consider using dedicated keys per chain. FILECOIN_RPC_URL=https://api.calibration.node.glif.io/rpc/v1 FILECOIN_PRIVATE_KEY= # GovernanceContract — deployed on both Filecoin Calibration and X Layer testnet. # Set after running tooling/scripts/deploy/deploy-hardhat.cjs or tooling/scripts/deploy/deploy-contracts.ts. GOVERNANCE_CONTRACT_ADDRESS=0x... # AIGovernanceStorage — audit record anchoring on FVM. # Set to enable FilecoinStorageService (dual-anchor alongside 0G). STORAGE_CONTRACT_ADDRESS=0x... # ----------------------------------------------------------------------------- # 0G Chain — On-Chain Governance Decision Proofs # ----------------------------------------------------------------------------- # Every governance evaluation (approved/denied/held) is recorded as a # GovernanceDecision event on 0G Galileo Testnet via the GovernanceProof # contract. Fire-and-forget — governance works without 0G; with it, every # decision is permanently verifiable on ChainScan. # # Explorer: https://chainscan-galileo.0g.ai # Faucet: https://faucet.0g.ai # 0G Chain RPC (Galileo Testnet, chain ID 16602) ZEROG_RPC_URL=https://evmrpc-testnet.0g.ai ZEROG_CHAIN_ID=16602 # Private key for posting proofs (defaults to OWS_BOOTSTRAP_PRIVATE_KEY) ZEROG_PRIVATE_KEY= # GovernanceProof V1 contract address (deployed on 0G Galileo Testnet) # Keep this unchanged while reviewing the separate V2 mainnet deployment. ZEROG_PROOF_CONTRACT=0x723e444ee6D7da19fADe372f85DA06dD849bF1E0 ZEROG_PROOF_VERSION=v1 # V2 mainnet proof anchor — keep these in the ignored `.env.0g-mainnet` # deployment file (or inject them from a secret manager), not in this shared # environment file. The poster key must be dedicated to proof posting and must # not be the admin or an execution/custody wallet. # ZEROG_PROOF_VERSION=v2 # ZEROG_MAINNET_ENV_FILE=.env.0g-mainnet # ZEROG_MAINNET_RPC_URL=https://evmrpc.0g.ai # ZEROG_MAINNET_CHAIN_ID=16661 # ZEROG_MAINNET_DEPLOYER_PRIVATE_KEY= # ZEROG_MAINNET_DEPLOYER_ADDRESS= # ZEROG_MAINNET_ADMIN= # ZEROG_MAINNET_POSTER= # ZEROG_MAINNET_POSTER_PRIVATE_KEY= # ZEROG_MAINNET_PROOF_CONTRACT= # # Preflight without sending a transaction: # ZEROG_MAINNET_ENV_FILE=.env.0g-mainnet pnpm zerog:proof:preflight # X Layer mainnet proof anchor — GovernanceProofV2 on X Layer Mainnet # (chainId 196). Keep these in the ignored `.env.xlayer-mainnet` deployment # file (or inject them from a secret manager), not in this shared environment # file. The poster key must be dedicated to proof posting and must not be the # admin or an execution/custody wallet. # XLAYER_PROOF_VERSION=v2 # XLAYER_MAINNET_ENV_FILE=.env.xlayer-mainnet # XLAYER_MAINNET_RPC_URL=https://rpc.xlayer.tech # XLAYER_MAINNET_CHAIN_ID=196 # XLAYER_MAINNET_DEPLOYER_PRIVATE_KEY= # XLAYER_MAINNET_DEPLOYER_ADDRESS= # XLAYER_MAINNET_ADMIN= # XLAYER_MAINNET_POSTER= # XLAYER_MAINNET_POSTER_PRIVATE_KEY= # XLAYER_MAINNET_PROOF_CONTRACT= # # The backend also accepts the rails-era EXECUTION_XLAYER_MAINNET_* names for # the RPC, chain ID, poster key, and contract values. # # Preflight without sending a transaction: # XLAYER_MAINNET_ENV_FILE=.env.xlayer-mainnet pnpm xlayer:proof:preflight # 0G Storage (optional — audit log anchoring via official 0G Storage SDK) # Standard is currently under maintenance; use Turbo for staging after the # guarded `pnpm zerog:roundtrip` test passes. Production remains explicit. ZEROG_INDEXER_URL=https://indexer-storage-testnet-standard.0g.ai # ----------------------------------------------------------------------------- # Sponsored Inference Credits — metered gateway (/v1/chat/completions) # ----------------------------------------------------------------------------- # A sponsor (e.g. a hackathon organiser) funds one upstream account; Cognivern # mints per-participant `cvk_` keys against it and enforces per-participant # budgets, which the 0G Router does not do itself (its rate limits are # per-account and it documents no per-key spend cap). # # 0G Compute Router: deposit once at pc.0g.ai, then create an sk- API key. # The Router is OpenAI-compatible, so this is the only upstream credential # needed. Keep it server-side only — whoever holds it can spend the deposit. ZEROG_ROUTER_BASE_URL=https://router-api.0g.ai/v1 ZEROG_ROUTER_API_KEY= # Optional mk- management key (pc.0g.ai -> Settings -> Management Keys, # "Read-only" preset: account:read, keys:read). Only this credential can read # GET /v1/account/balance — sk- keys are 403 on /v1/account/* by design. When # set, the sponsor dashboard reconciles the ledger pool against the real 0G # deposit and warns before commitments exceed it (no more silent mid-event 402). ZEROG_ROUTER_MANAGEMENT_KEY= # USD per 1 0G token. Required to convert the Router's neuron-denominated # catalog prices into the ledger's USD accounting. Leave unset to skip catalog # pricing entirely and rely on GATEWAY_STATIC_PRICES below. ZEROG_ZG_USD_RATE= # Native price denominator (1e18 neuron = 1 0G). Only change if 0G does. ZEROG_NATIVE_DECIMALS=1000000000000000000 # Explicit USD-per-1K-token overrides, used when the catalog is unavailable or # omits a model. The "*" key applies to every model. # Example: {"*":{"promptUsdPer1k":0.003,"completionUsdPer1k":0.009}} # BYO Anthropic programs price exclusively from this table (the backend aims # no catalog fetch at a per-program key), so set entries per model id you # allow — e.g. {"claude-haiku-4-5":{"promptUsdPer1k":0.001,"completionUsdPer1k":0.005}}. GATEWAY_STATIC_PRICES= # Last-resort rates for a model with no catalog and no static entry. Set # deliberately high: over-billing is refundable, silently unmetered inference # is not. GATEWAY_FALLBACK_PROMPT_USD_PER_1K=0.01 GATEWAY_FALLBACK_COMPLETION_USD_PER_1K=0.03 # Multiplier applied to the estimated worst-case cost when reserving credit # before a call. Above 1.0 so token estimation error cannot cause an overdraft. GATEWAY_HOLD_SAFETY_FACTOR=1.25 # Output-token ceiling when neither the client nor the program sets one. GATEWAY_DEFAULT_MAX_OUTPUT_TOKENS=2048 # Max characters of prompt/response excerpt stored — and ONLY for participants # who chose the `open` disclosure tier. Credentials are stripped at every tier. GATEWAY_EXCERPT_MAX_CHARS=500 # Model catalog cache TTL and timeouts. GATEWAY_CATALOG_TTL_MS=300000 GATEWAY_CATALOG_TIMEOUT_MS=15000 GATEWAY_UPSTREAM_TIMEOUT_MS=120000 # How often the backend anchors a Merkle commitment over each active program's # participant balances to 0G Storage + Filecoin (milliseconds, default 1h). # Anchoring also fires automatically when a program closes. The anchored root # lets anyone verify a participant's receipt without trusting this server. CREDIT_COMMITMENT_INTERVAL_MS=3600000 # ----------------------------------------------------------------------------- # MongoDB Atlas — Persistent Agent Memory & Run Ledger # ----------------------------------------------------------------------------- # Required for MongoDB-backed persistence (run ledger, agent memory). # Create a free cluster at https://cloud.mongodb.com, then set your connection string. # Format: mongodb+srv://:@.mongodb.net/?retryWrites=true&w=majority MONGODB_URI= # Database name (default: cognivern) MONGODB_DB_NAME=cognivern # ----------------------------------------------------------------------------- # CRE Run Ledger — local JSONL run store # ----------------------------------------------------------------------------- # Maximum number of CRE runs retained in memory and in the local JSONL store # (default 1000). Oldest runs are evicted first when the cap is exceeded; the # store merges writes across processes, so raising this never risks losing the # most recent evidence. Historically 100 — bumped to 1000 for submission-scale # evidence retention. Override per environment as needed. CRE_MAX_RUNS=1000 # Optional explicit file locations; defaults are /data/cre-runs.jsonl and # a cre-ledger.jsonl next to it. In production the app/data dir is symlinked # to shared/data, which is where both live. # CRE_RUNS_FILE= # CRE_LEDGER_FILE= # ----------------------------------------------------------------------------- # HydraDB — Agent Memory & Recall (Agents Under Pressure hackathon) # ----------------------------------------------------------------------------- # Required for persistent agent memory across sessions. # The frontend (OS Terminal `hydra` commands) uses the same v2 API + key as # the backend HYDRADB_* vars. Sign up at https://app.hydradb.com to get your # key, then set these in the Next.js/Vercel environment: HYDRADB_API_KEY= HYDRADB_DATABASE=cognivern HYDRADB_COLLECTION=cognivern_os # ----------------------------------------------------------------------------- # LLM Providers # ----------------------------------------------------------------------------- # At least one provider key is required OPENAI_API_KEY=sk-your_openai_api_key # Optional fallbacks GROQ_API_KEY= CEREBRAS_API_KEY= ROUTEWAY_API_KEY= FIREWORKS_API_KEY= VENICE_API_KEY= KILOCODE_API_KEY= GEMINI_API_KEY= ANTHROPIC_API_KEY= # ----------------------------------------------------------------------------- # Together AI (Governance Policy Evaluator — Agents Assemble integration) # ----------------------------------------------------------------------------- # Required for AI-powered policy evaluation via Together AI inference # Get your key at: https://api.together.xyz/settings/api-keys TOGETHER_API_KEY=your_together_api_key_here # Optional: override the default model (Llama-3.3-70B-Instruct-Turbo) TOGETHER_MODEL=meta-llama/Llama-3.3-70B-Instruct-Turbo # ----------------------------------------------------------------------------- # Arbitrum One (SIWE chain config for the governance deployment footprint) # ----------------------------------------------------------------------------- ARBITRUM_RPC_URL=https://arb1.arbitrum.io/rpc ARBITRUM_SEPOLIA_RPC_URL=https://sepolia-rollup.arbitrum.io/rpc # ----------------------------------------------------------------------------- # Arbitrum Sepolia (Governance deployment — primary Arbitrum footprint) # ----------------------------------------------------------------------------- # Cognivern GovernanceContract + GovernedVault, deployed to Arbitrum Sepolia # (chain 421614). Live addresses below. Set ARBITRUM_PRIVATE_KEY to redeploy; # falls back to FHENIX_PRIVATE_KEY if unset. ARBITRUM_PRIVATE_KEY= ARBITRUM_GOVERNANCE_CONTRACT_ADDRESS=0xB5326cEEDBb52C8ec9905929F5f612F7ac9819cE ARBITRUM_VAULT_ADDRESS=0x468F1CfBB5bec9352b279192a952916610f58BB4 # Manifest (records the same addresses set above): deploy-bundle/arbitrum-sepolia-deployment.json # FHE confidential policy eval runs on Arbitrum Sepolia (chain 421614) via # CoFHE — TaskManager 0xeA30c4B8b44078Bbf8a6ef5b9f1eC1626C7848D9 is live there # (arb-sepolia is fully supported by cofhe-contracts@0.1.3 / @cofhe/sdk@0.5.2). # Co-processor endpoints are in the Fhenix / coFHE section below. # ----------------------------------------------------------------------------- # Robinhood Chain Testnet (Arbitrum Orbit — chain 46630) # ----------------------------------------------------------------------------- # Cognivern GovernanceContract + GovernedVault, deployed to Robinhood Chain # Testnet for the Arbitrum London Founder House. Faucet: # https://faucet.testnet.chain.robinhood.com Explorer: # https://explorer.testnet.chain.robinhood.com # Set ROBINHOOD_CHAIN_PRIVATE_KEY to redeploy; falls back to FHENIX_PRIVATE_KEY # then FILECOIN_PRIVATE_KEY if unset. ROBINHOOD_CHAIN_TESTNET_RPC_URL=https://rpc.testnet.chain.robinhood.com ROBINHOOD_GOVERNANCE_CONTRACT_ADDRESS=0x723e444ee6D7da19fADe372f85DA06dD849bF1E0 ROBINHOOD_VAULT_ADDRESS=0xeA88BD6121d181cFD6F60997B4BDd0297CA432fE # Manifest: docs/robinhood-chain-deployment.json # ----------------------------------------------------------------------------- # OWS Wallet (optional) # ----------------------------------------------------------------------------- OWS_VAULT_SECRET=development-ows-vault-secret OWS_API_KEY= OWS_EXTERNAL_WALLET_URL= OWS_EXTERNAL_WALLET_PRIVATE_KEY= # ----------------------------------------------------------------------------- # KeeperHub — Managed On-Chain Execution Layer (optional) # ----------------------------------------------------------------------------- # When set, wallets can route native value transfers through KeeperHub # instead of a local RPC. Set a wallet's metadata.executionProvider to # "keeperhub" to enable. KEEPERHUB_API_KEY is your Organization API key from # https://app.keeperhub.com. KEEPERHUB_BASE_URL can be left as the default. KEEPERHUB_API_KEY= KEEPERHUB_BASE_URL=https://app.keeperhub.com # ----------------------------------------------------------------------------- # Dynamic — MPC server wallets for agent signing / execution (optional) # ----------------------------------------------------------------------------- # Supplementary custody: Cognivern keeps policy + CRE; Dynamic holds MPC keys. # Pattern: server wallets (API token). Docs: docs/DYNAMIC.md # DYNAMIC_ENABLED=true # DYNAMIC_ENVIRONMENT_ID= # DYNAMIC_API_TOKEN= # DYNAMIC_WALLET_PASSWORD= # DYNAMIC_SERVER_WALLET_ADDRESS= # DYNAMIC_WALLET_METADATA_PATH=.cognivern/dynamic-server-wallet.json # DYNAMIC_WALLET_METADATA_JSON= # ----------------------------------------------------------------------------- # Cleanverse — CVI (A-Pass) + CVA (A-Token) verified agent capital rail # ----------------------------------------------------------------------------- # When set, wallets with metadata.executionProvider="cleanverse" screen # sender/recipient via A-Pass (CVI) before policy approval and settle # approved spends as Access USDC (aUSDC) ERC-20 transfers on Monad testnet (CVA). # Credentials come from the Cleanverse hackathon registration email. # Docs: https://docs.cleanverse.com (invite-gated) CLEANVERSE_API_ID= CLEANVERSE_API_KEY= CLEANVERSE_API_URL=https://uatapi.cleanverse.com/api/cooperate CLEANVERSE_CHAIN=monad # Cleanverse Access USDC contract on Monad testnet (chain 10143). CLEANVERSE_ATOKEN_ADDRESS=0xaC0893567D43C3E7e6e35a72803df05416C1f20D CLEANVERSE_ATOKEN_SYMBOL=aUSDC CLEANVERSE_ATOKEN_DECIMALS=6 # Optional operator-pinned deposit address for one wallet/status display. # Dynamic lookup: GET /api/cleanverse/deposit-address?address=0x... CLEANVERSE_DEPOSIT_ADDRESS= CLEANVERSE_DEPOSIT_FOR_ADDRESS= # When true, every spend is A-Pass gated (even local/keeperhub wallets). CLEANVERSE_GATE_ALL_SPENDS=false # Institutional country rule on A-Pass country tags (v5.5, ISO 3166-1 # alpha-2, comma-separated). Set an allow list to whitelist both parties # (fail-closed: an A-Pass with no country tags is denied), or a block list # to deny blocked tags. Unset = no country constraint. If both are set the # block list wins (fail-closed). Mirrors the A-Token rule's is_black_list # + countries semantics. CLEANVERSE_ALLOW_COUNTRIES= CLEANVERSE_BLOCK_COUNTRIES= MONAD_RPC_URL=https://testnet-rpc.monad.xyz MONAD_CHAIN_ID=10143 # Monad mainnet (chain 143) — used by rails that aren't pinned to testnet # (ERC-8004 identity/reputation today; any future mainnet settlement). MONAD_MAINNET_RPC_URL=https://rpc.monad.xyz # ----------------------------------------------------------------------------- # ERC-8004 — Trustless Agents identity + reputation on Monad (Metropolis T4) # ----------------------------------------------------------------------------- # Registers OWS agents in the on-chain IdentityRegistry (the agent's vault # wallet owns the ERC-721 identity) and publishes run outcomes to the # ReputationRegistry. Inert until ERC8004_ENABLED=true. Registries are the # canonical per-chain deployments; override only for a custom deployment. ERC8004_ENABLED=false # 143 = Monad mainnet, 10143 = testnet. Registry defaults resolve per chain. ERC8004_CHAIN_ID=143 ERC8004_RPC_URL= ERC8004_IDENTITY_REGISTRY= ERC8004_REPUTATION_REGISTRY= # Public HTTPS base used to build agentURI links, e.g. # https://api.cognivern.persidian.com — the card is served at # {base}/erc8004/agents/{agentId}/card. Unset → the registration file is # embedded on-chain as a data: URI instead. ERC8004_PUBLIC_BASE_URL= # ----------------------------------------------------------------------------- # Envio HyperIndex → CRE evidence (optional) # ----------------------------------------------------------------------------- # Pulls events indexed by the Envio project in indexers/envio/ (aUSDC # settlements, ERC-8004 registrations, reputation feedback) and materializes # them as signed CRE artifacts. Inert until ENVIO_ENABLED=true and a GraphQL # endpoint is set (local `envio dev` serves http://localhost:8080/v1/graphql). ENVIO_ENABLED=false ENVIO_GRAPHQL_URL= ENVIO_API_KEY= # Cursor/dedupe state for the sync loop. ENVIO_STATE_PATH= # Used by the indexer process itself (indexers/envio, `pnpm dev`) — HyperSync # and HyperRPC endpoints require a free token from app.envio.dev/api-tokens. ENVIO_API_TOKEN= # ----------------------------------------------------------------------------- # MCP Server (optional) # ----------------------------------------------------------------------------- MCP_ENABLED=false MCP_DEFAULT_SERVER=ows-governance MCP_API_KEY= # ----------------------------------------------------------------------------- # Rate Limiting # ----------------------------------------------------------------------------- RATE_LIMIT_WINDOW_MS=900000 RATE_LIMIT_MAX_REQUESTS=100 # ----------------------------------------------------------------------------- # Governance Defaults # ----------------------------------------------------------------------------- DEFAULT_POLICY=standard # ----------------------------------------------------------------------------- # Structured Alerting (optional — Slack / PagerDuty) # ----------------------------------------------------------------------------- # When set, critical governance decisions (denied/flagged) are forwarded # to these alert sinks alongside the existing webhook notifications. SLACK_WEBHOOK_URL= PAGERDUTY_ROUTING_KEY= # ----------------------------------------------------------------------------- # Optional: External APIs # ----------------------------------------------------------------------------- ALCHEMY_API_KEY= ETHERSCAN_API_KEY= # ----------------------------------------------------------------------------- # Optional: Voice (ElevenLabs) # ----------------------------------------------------------------------------- ELEVENLABS_API_KEY= # ----------------------------------------------------------------------------- # Optional: fal.ai (image generation for demo video character/motif assets) # ----------------------------------------------------------------------------- # Used by tooling/scripts/demo/generate-demo-assets.ts to render the cast of # characters, motifs, and artifacts composited into the demo video. Get a key # at https://fal.ai/dashboard/keys. FAL_KEY= # ----------------------------------------------------------------------------- # Optional: ChainGPT (Smart Contract Auditing) # ----------------------------------------------------------------------------- CHAINGPT_API_KEY= # HMAC secret for inbound POST /api/webhooks/chain-gpt-news. # Sign the raw body as HMAC-SHA256 of `{unixSeconds}.{rawBody}` and send: # X-Webhook-Signature: sha256= # X-Webhook-Timestamp: CHAINGPT_WEBHOOK_SECRET= CHAINGPT_BASE_URL=https://api.chaingpt.org CHAINGPT_AUDIT_TIMEOUT_MS=30000 # How long a contract audit stays cached (default 1 hour). CHAINGPT_AUDIT_CACHE_TTL_MS=3600000 # Optional override paths (default: next to DB_PATH / shared data dir). # CHAINGPT_AUDIT_CACHE_FILE=/opt/cognivern/shared/data/chaingpt-audit-cache.json # CHAINGPT_BUDGET_FILE=/opt/cognivern/shared/data/chaingpt-daily-budget.json # Max ChainGPT API calls per UTC day (0 = unlimited). Applies to auditor + chat. CHAINGPT_DAILY_CALL_BUDGET=100 # ----------------------------------------------------------------------------- # Optional: OpenZeppelin Defender (Runtime Monitoring) # ----------------------------------------------------------------------------- OZ_DEFENDER_API_KEY= OZ_DEFENDER_API_SECRET= # ----------------------------------------------------------------------------- # EVM execution rails (default + secondary) # ----------------------------------------------------------------------------- # Prefer EXECUTION_* names. Legacy XLAYER_* aliases are still accepted. # Default rail = public native transfer + governance-anchor host. EXECUTION_RAIL_ID=xlayer-testnet EXECUTION_CHAIN_ID=1952 EXECUTION_RPC_URL=https://testrpc.xlayer.tech EXECUTION_PRIVATE_KEY= EXECUTION_GOVERNANCE_CONTRACT_ADDRESS=0x755602bBcAD94ccA126Cfc9E5Fa697432D9e2DD6 EXECUTION_STORAGE_CONTRACT_ADDRESS=0x1E0317beFf188e314BbC3483e06773EEfa28bB2D # Legacy aliases (optional if EXECUTION_* are set): # XLAYER_CHAIN_ID=1952 # XLAYER_TESTNET_RPC_URL=https://testrpc.xlayer.tech # XLAYER_PRIVATE_KEY= # XLAYER_GOVERNANCE_CONTRACT_ADDRESS= # XLAYER_STORAGE_CONTRACT_ADDRESS= # Second EVM rail (Mantle Sepolia) — optional; proves local transfers are multi-rail. # EXECUTION_MANTLE_SEPOLIA_RPC_URL=https://rpc.sepolia.mantle.xyz # EXECUTION_MANTLE_SEPOLIA_CHAIN_ID=5003 # EXECUTION_MANTLE_SEPOLIA_PRIVATE_KEY= # ----------------------------------------------------------------------------- # Mantle L2 (Agent Execution Layer) # ----------------------------------------------------------------------------- # Required for deploying GovernedVault on Mantle — agents execute DeFi here MANTLE_RPC_URL=https://rpc.mantle.xyz MANTLE_SEPOLIA_RPC_URL=https://rpc.sepolia.mantle.xyz MANTLE_PRIVATE_KEY= MANTLE_VAULT_ADDRESS=0x... # ----------------------------------------------------------------------------- # Fhenix / coFHE (Confidential Policy Evaluations) # ----------------------------------------------------------------------------- # The coFHE plugin is `@cofhe/hardhat-plugin@0.5.2`. The live testnet services # are at testnet-cofhe.fhenix.zone (coFHE), testnet-cofhe-vrf.fhenix.zone # (verifier), and testnet-cofhe-tn.fhenix.zone (threshold network). # The TaskManager proxy lives on Arbitrum Sepolia at 0xeA30c4B…7848D9 # (hardcoded in @fhenixprotocol/cofhe-contracts@0.1.3). # ConfidentialSpendPolicy is live on Arbitrum Sepolia at # 0x710005F7454B8756F7E1118B26d1361b001fc818 (owned by the deployer). # See docs/DEV.md and tooling/scripts/deploy/test-fhe-onchain.ts. FHENIX_RPC_URL=https://sepolia-rollup.arbitrum.io/rpc FHENIX_SEPOLIA_RPC=https://sepolia-rollup.arbitrum.io/rpc FHENIX_POLICY_CONTRACT=0x710005F7454B8756F7E1118B26d1361b001fc818 # The three coFHE service URLs (overridable for testnets / private infra) FHENIX_COFHE_URL=https://testnet-cofhe.fhenix.zone FHENIX_VERIFIER_URL=https://testnet-cofhe-vrf.fhenix.zone FHENIX_TN_URL=https://testnet-cofhe-tn.fhenix.zone # Falls back to ARBITRUM_PRIVATE_KEY (or FILECOIN_PRIVATE_KEY) if not set. FHENIX_PRIVATE_KEY= # Optional: timeout for FHE evaluation in milliseconds (default: 30000) FHE_EVALUATE_TIMEOUT_MS=30000 # FHE Decision Watcher — automates the two-phase FHE resolution flow. # When enabled, watches for Pending outcomes from evaluateSpend, polls # the FHEOS threshold decryption endpoint, and calls resolveDecision. FHE_WATCHER_ENABLED=false # Poll interval for checking pending FHE decisions (default: 5000ms) FHE_WATCHER_POLL_INTERVAL_MS=5000 # Control Evaluation Mode — parallel suspicion scoring for AI agent monitoring # When enabled, every governance evaluation gets a suspicion score (0-1) # stored in the audit trail. Does not change approve/deny decisions. CONTROL_EVAL_MODE=false # Auto-hold threshold: if set > 0, actions with suspicion composite >= this # value are held for human review instead of auto-approved. Requires # CONTROL_EVAL_MODE=true. Recommended: 0.8 for conservative, 0.6 for moderate. SUSPICION_HOLD_THRESHOLD=0 # Privara / Confidential Payroll (optional — falls back to FHENIX_PRIVATE_KEY) PRIVARA_PRIVATE_KEY= PRIVARA_RPC_URL=https://sepolia-rollup.arbitrum.io/rpc PRIVARA_NETWORK=testnet # ----------------------------------------------------------------------------- # Flare Confidential Compute (FCC) — Coston2 (Flare Summer Signal) # ----------------------------------------------------------------------------- # Bounty 2 port of confidential spend-policy onto Flare Compute Extensions. # Inert by default — does not change live Fhenix/Canton/Monad behavior. # Docs: docs/FLARE.md · contracts/flare/README.md # FCC overview: https://dev.flare.network/fcc/overview # Faucet: https://faucet.flare.network/coston2 FLARE_RPC_URL=https://coston2-api.flare.network/ext/C/rpc FLARE_CHAIN_ID=114 # Funded Coston2 deployer / evaluator key (hex with or without 0x). FLARE_PRIVATE_KEY= # Set after ConfidentialSpendPolicy is deployed + extension registered. FLARE_POLICY_CONTRACT= # FlareTeeManager diamond — both TeeExtensionRegistry + TeeMachineRegistry. FLARE_TEE_MANAGER=0x1a9C4A0f9D76c0b1D91d22E24E573a9b377618aE # Public HTTPS URL of your ext-proxy tunnel (ngrok/cloudflared → :6674). FLARE_EXT_PROXY_URL= # Flare's Coston2 normal/FTDC proxy (scaffold default). FLARE_NORMAL_PROXY_URL=https://tee-proxy-coston2-1.flare.rocks # Feature flag for backend spend-eval dispatch ("flare" enables CSP-Flare). FLARE_EVALUATOR= # Optional: FCC extension id assigned at registration time. FLARE_EXTENSION_ID= # ----------------------------------------------------------------------------- # Optional: Ethereum RPC (for bytecode analysis) # ----------------------------------------------------------------------------- ETHEREUM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/your_key # ----------------------------------------------------------------------------- # Canton Network (HackCanton S3 DevNet tenant) # ----------------------------------------------------------------------------- # JSON Ledger API v2 endpoint. S3 tenant `hackcanton-devnet-3` on the shared node: # https://ledger-api-json.participant.hackcanton-01.devnet.naas.noders.services:443 CANTON_JSON_API_URL= CANTON_LEDGER_ID=hackcanton-01 CANTON_LEDGER_USER_ID= CANTON_APPLICATION_ID=cognivern # Daml template IDs. Canton v2 JSON Ledger API accepts package-name references # (#::) for commands/queries; events still return # full package IDs, which the client resolves automatically. # KEEP THE QUOTES: dotenv parses an unquoted #… value as an empty string, # which boots the backend with Canton silently disabled. CANTON_TEMPLATE_AUCTION="#daml:Main:SealedBidAuction" CANTON_TEMPLATE_BID="#daml:Main:Bid" CANTON_TEMPLATE_RESULT="#daml:Main:AuctionResult" CANTON_TEMPLATE_DEPOSIT="#daml:Main:PaymentDeposit" # DAR v0.0.3+ only: enables round cancellation (SealedBidAuction.Cancel → # Main:AuctionCancelled). Leave unset against daml-0.0.2 — the backend then # reports cancel as unsupported instead of sending a missing-template exercise. CANTON_TEMPLATE_CANCELLED="#daml:Main:AuctionCancelled" # Authentication: obtain a Bearer token from the NODERS Keycloak password grant. # CANTON_BEARER_TOKEN is used directly if set; otherwise the backend can fall # back to the OIDC password grant using the values below. CANTON_BEARER_TOKEN= CANTON_OIDC_TOKEN_URL=https://keycloak.naas.noders.services/realms/noders-appsfactory/protocol/openid-connect/token CANTON_OIDC_CLIENT_ID=web-app-ui-hackcanton-01-devnet CANTON_OIDC_USERNAME= CANTON_OIDC_PASSWORD= CANTON_OIDC_AUDIENCE=https://hackcanton-01.devnet.naas.noders.services CANTON_OIDC_SCOPE=openid daml_ledger_api offline_access # Demo party names. S3 uses per-team namespaces (e.g. e6c5f9fc-alice); S2 # used -cognivern suffixes. Set these to match the parties allocated on the # DevNet participant. CANTON_DEMO_MANAGER_NAME=auctioner-cognivern CANTON_DEMO_BIDDER_NAMES=alice-cognivern,bob-cognivern,charlie-cognivern # Static mapping of demo party names to full Canton party identifiers. # Required on shared DevNet nodes where the authenticated user cannot list or # allocate parties. Format: name=partyId,name=partyId,... CANTON_DEMO_PARTY_IDS=auctioner-cognivern=auctioner-cognivern::122003aa7c491e00a453145c4d2cd3dbf5db8908b4e663c9944baed57fd66effa668,alice-cognivern=alice-cognivern::122003aa7c491e00a453145c4d2cd3dbf5db8908b4e663c9944baed57fd66effa668,bob-cognivern=bob-cognivern::122003aa7c491e00a453145c4d2cd3dbf5db8908b4e663c9944baed57fd66effa668,charlie-cognivern=charlie-cognivern::122003aa7c491e00a453145c4d2cd3dbf5db8908b4e663c9944baed57fd66effa668 # Institution pool parties assigned to SIWE-authenticated wallets for # production-mode bidding (GET /api/vendor/sealed-bid/canton-identity). # First-come assignment, persisted so a wallet keeps its party; unset # disables the endpoint (503). CANTON_POOL_PARTY_NAMES= # Optional path for the wallet→party JSONL store (defaults under backend data dir). CANTON_WALLET_PARTY_STORE= # ----------------------------------------------------------------------------- # OpenTelemetry / SigNoz (optional - leave blank to disable OTel) # ----------------------------------------------------------------------------- # Set to your SigNoz Cloud OTLP endpoint (e.g. https://us.ingest.signoz.cloud) # or self-hosted SigNoz at http://localhost:4318 OTEL_EXPORTER_OTLP_ENDPOINT= # NO-VENDOR PATH: serve the same instruments as Prometheus text format on a # local port (the OTel default is 9464). Point a self-hosted Prometheus/Grafana # — or `curl localhost:9464/metrics` — at it. No SigNoz account required; the # two paths can also run side by side. Leave blank to disable. OTEL_PROMETHEUS_PORT= # SigNoz Cloud ingestion key (from Settings -> Ingestion). Sent as # signoz-access-token header. Leave blank for self-hosted (no auth). SIGNOZ_INGESTION_KEY= # Service name shown in SigNoz Services list OTEL_SERVICE_NAME=cognivern-backend # Optional: SigNoz Cloud URL for trace deep-links from the audit page. # E.g. https://us.signoz.cloud SIGNOZ_CLOUD_URL= # Optional: SigNoz dashboard public share URL for inline embedding in the # Observability page. Enable public sharing on a dashboard in SigNoz Cloud, # copy the share URL, and set it here. Renders as an iframe. SIGNOZ_DASHBOARD_EMBED_URL= # Optional: SigNoz Service Account API key for querying metrics/traces from # the Observability page (Settings -> Service Accounts -> Keys). Used by # /api/observability/metrics. This is different from the ingestion key above. SIGNOZ_API_KEY= # Self-hosted WITHOUT an enterprise license: service-account keys cannot be # authorized for builder queries (fine-grained RBAC is license-gated). The # controller instead logs in as this user and caches the session JWT. On # unlicensed self-hosts this must be the seeded install admin (role-granted # users still get authz_forbidden on builder_query). SIGNOZ_API_KEY above # takes precedence when no user creds are set (e.g. SigNoz Cloud). SIGNOZ_USER_EMAIL= SIGNOZ_USER_PASSWORD= SIGNOZ_ORG_ID= # ----------------------------------------------------------------------------- # HydraDB — agentic memory / cross-source retrieval (optional) # ----------------------------------------------------------------------------- # Free tier: unlimited API calls & tenants. When HYDRADB_ENABLED=false (default), # all HydraDB services no-op and cognivern behaves exactly as without the # integration. Get a key at https://app.hydradb.com. HYDRADB_ENABLED=false HYDRADB_API_KEY= HYDRADB_DATABASE=cognivern HYDRADB_COLLECTION=default HYDRADB_BASE_URL=https://api.hydradb.com HYDRADB_API_VERSION=2 # Retrieval mode router: "auto" classifies per-query (fast for single-hop, # thinking for multi-hop). Set to "fast" or "thinking" to force one mode. HYDRADB_DEFAULT_MODE=auto HYDRADB_REQUEST_TIMEOUT_MS=30000 # ----------------------------------------------------------------------------- # HydraDB connectors (optional) — extractors for cross-source retrieval # ----------------------------------------------------------------------------- # GitHub: optional token to raise rate limit from 60/hr to 5000/hr. # Without it, public-repo reads still work (60/hr). Repo defaults to this repo. # GITHUB_TOKEN is also the auth for the GitHub outcome connector # (POST /api/mandates/:id/outcomes/sync); a fine-grained PAT with read-only # contents + pull_requests on the target repo is sufficient. GITHUB_TOKEN= GITHUB_REPO=thisyearnofear/cognivern # Langfuse outcome connector (optional) — ingest scores/traces as # system_observed mandate outcomes. Project API keys from Langfuse # Settings → API Keys. Used by POST /api/mandates/:id/outcomes/sync when # a mandate has type:"langfuse" outcomeSources. See docs/LANGFUSE_LESSONS.md. LANGFUSE_PUBLIC_KEY= LANGFUSE_SECRET_KEY= # Linear: personal API key from https://linear.app/settings/api. # Without it, the Linear connector exits cleanly (optional — GitHub + audit # ledger already provide 2 sources). LINEAR_API_KEY= # Attio: personal access token (Settings → Developer in your Attio workspace). # Personal access tokens also require ATTIO_WORKSPACE= # (the workspace the token was created in). This is the 3rd connector from the # challenge's list (with GitHub + Linear) that makes the ≥3-connector bar. ATTIO_API_KEY= ATTIO_WORKSPACE= # Objects to ingest from Attio (comma-separated). Defaults to people,companies. # ATTIO_OBJECTS=people,companies # ----------------------------------------------------------------------------- # Telegraph Protocol — Verified AI Intelligence Network (Track 3) # ----------------------------------------------------------------------------- # Telegraph connects agents to ranked AI miners with x402 micropayments. # When enabled, agents can call verified intelligence sources (weather, LLM, # AI-detection, deepfake, etc.) through governed spend policies. # Docs: https://docs.telegraphprotocol.com # Hackathon: https://hackathon.telegraphprotocol.com TELEGRAPH_ENABLED=false # Telegraph node endpoints (live testnet node) # NOTE: engine and daemon live under the node's /engine and /daemon paths — # the legacy :8080/:8081 ports from the MCP README are stale on the live node. TELEGRAPH_NODE_URL=http://13.237.89.59:7044 TELEGRAPH_ENGINE_URL=http://13.237.89.59:7044/engine TELEGRAPH_DAEMON_URL=http://13.237.89.59:7044/daemon # EVM private key for x402 payments (burner wallet recommended) # x402 payments are ~$0.01 per inference call, settled in USDC via EIP-3009 # Never use your main wallet - fund with only the USDC needed for testing TELEGRAPH_EVM_PRIVATE_KEY= # Optional: Solana private key (base58) for SVM network support TELEGRAPH_SOLANA_PRIVATE_KEY= # Network configuration (CAIP-2 format) TELEGRAPH_EVM_NETWORK=eip155:* TELEGRAPH_SVM_NETWORK=solana:* # Miner tool refresh interval (ms). Set to 0 to disable auto-refresh. # Telegraph auto-discovers new miners every REFRESH_INTERVAL_MS TELEGRAPH_REFRESH_INTERVAL_MS=300000 # Confidence threshold for auto-approval (0.0-1.0) # Miner responses below this confidence are held for operator review TELEGRAPH_CONFIDENCE_THRESHOLD=0.7 # Feature flag: route inference through Telegraph vs direct provider # Set to "telegraph" to enable, empty to use default providers TELEGRAPH_INFERENCE_PROVIDER= # Signal digest loop interval (ms). Set to 0 for one-shot. # Default 21600000 = run every 6 hours. TELEGRAPH_LOOP_INTERVAL=21600000 # Signal digest tuning TELEGRAPH_SIGNAL_MIN_INTEREST=6 TELEGRAPH_SIGNAL_LIMIT=5 # ----------------------------------------------------------------------------- # Runware decisions — System-One classification (Laya / Jev) # ----------------------------------------------------------------------------- # Optional decision-model enrichment for the sponsor report's task-class # column. When enabled, gateway calls race a Runware `/v1/decisions` choice # question against the upstream inference call; a resolved label replaces the # keyword heuristic and its confidence is shown per call in the activity # feed. Reporting only — never gates, denies, or penalises. Disabled or # failing adapter falls back to the heuristic with zero behavior change. # Laya (`runware:laya@1`) is FREE until Oct 12 2026; after that it is metered # like any upstream call, so budget it or turn this off. RUNWARE_DECISIONS_ENABLED=false RUNWARE_API_KEY= # Model id: `runware:laya@1` (open-weight) or `typesafe:jev@1` (hosted). RUNWARE_DECISION_MODEL=runware:laya@1 # Adapter timeout (ms). The call races upstream inference, so this only bites # when upstream is faster than the decision — then the heuristic wins. RUNWARE_DECISIONS_TIMEOUT_MS=5000