A lightweight, self-hostable multi-cloud control plane: a FastAPI job/worker backend, a React GUI, per-tenant isolation, Prometheus metrics, an audit trail, a plugin registry, read-only multi-cloud inventory, policy findings, SQL queries, cost analytics, budgets, rightsizing, tenant-scoped workflow DAGs, a service catalog with quotas, CI/IaC generators, signed webhooks, governed agent/MCP-style tools, deterministic question answering, offline runbooks, plugin manifests, deployment mode templates, an SBOM generator, a guarded apply framework with a hash-chained audit export, tenant-scoped inventory snapshots with drift diffs, tag-derived ownership maps, saved read-only views, manual drift-rule checks, declarative policy bundles evaluated offline, deployment-local bundle attestation, verifiable offline governance evidence packs, opt-in scheduling of read-only checks with severity-filtered alert sinks, heuristic resource context maps with read-only discovery plans, role-gated saved-view sharing, opt-in public-key signed policy bundles with trust tiers, opt-in external policy-engine adapters, credentialed provider adapters with guarded real apply, a CLI and a Python SDK, plus operator-supplied FOCUS reconciliation with durable export/retention, plan-only rightsizing acceptance, preview delivery proof, reproducible case-study publishing, explicit identity-claim federation/group-to-role mapping, SCIM-like provisioning records, offline Postgres/RLS migration scaffolding, tenant lifecycle export and centralized RBAC policy decisions.
Status: Phase 16 core preview — not production-ready. Local/private use only until you disable dev mode and configure JWT authentication. The AI surface is deterministic and self-hosted: local extractive retrieval with no external LLM, network access or provider writes. Inventory adapters are read-only; Phase 13 adds credentialed apply adapters that may make a narrow set of real provider writes only when every gate is satisfied (see "Credentialed guarded apply" below). Costs are estimates until you ingest a real FOCUS export. Plans, workflows, agent proposals and apply plans run offline/dry-run by default. The default apply adapter is
dry-run(no side effects);local-logrecords locally in memory and requires explicitconfirm=trueplusPEACLOUD_ALLOW_APPLY=true;provider-stubalways refuses and makes no network calls. The built-indry-run,local-logandprovider-stubadapters still make no provider writes; only explicitly registeredprovider-*adapters under the full gate chain may write. Snapshots, diffs, ownership maps and saved views are explicit, local and read-only: snapshots are point-in-time copies of the current inventory, diffs never poll providers and views only filter inventory. Drift checks and policy bundles are invoked explicitly: rules and bundles are deterministic and read-only, checks are manual and proposed actions are never executed. Checks remain manual by default: Phase 10 scheduling is opt-in only — the background loop starts only whenPEACLOUD_SCHEDULER_ENABLEDis truthy andstart()is explicitly invoked — and it reuses read-only checks rather than providing automatic drift detection in the default product. The built-in evaluator stays offline; external OPA/Cedar/Custodian-style engines are opt-in adapters that call an explicitly configured service only when evaluation is invoked, with no engine binary bundled. The hash-chained audit export is not a compliance certification. Bundle and evidence-pack attestation use deployment-local HMAC with the existingPEACLOUD_APPROVAL_SECRETshared secret: this is not a signed software release, a public-key/third-party signature, SOC2 or any certification, and it is not production readiness. Evidence packs are point-in-time JSON assembled on demand from already-shipped local state; they are not collected continuously and involve no provider write, network call or external policy engine. Bundle attestation is advisory by default and is only enforced whenPEACLOUD_REQUIRE_ATTESTED_BUNDLESis truthy. Resource context is read-only: relationships are heuristic markers derived on demand from inventory tags/metadata and Kubernetes owner references, not authoritative topology; discovery sources are explicitly configured and plans only describe what would be queried, with no automatic provider calls, invented credentials or granted access; saved-view sharing is tenant-scoped and role-gated, not a public link or hosted collaboration service. Phase 12 adds opt-in Ed25519 public-key signatures for policy bundles only, with locally managed keys and trust tierscommunity(default),attested(deployment-local HMAC) andsigned(public-key). This is not a signed software release, certificate/CA, third-party endorsement, SOC2 certification or production readiness. The optionalcryptographydependency (requirements-trust.txt) is not needed for core PeaCloud or HMAC attestation; if absent, signing/verification fails with a clear error. All new code is read-only with no provider writes: bundle verification and trust-authority planning are offline, and the only network egress is to an explicitly configured engine endpoint (https any host, http only localhost/127.0.0.1) when evaluation is explicitly invoked. Phase 13 credential expansion is read-only: it uses safe source metadata plus Phase 11 discovery sources, checks adapter availability locally viabuild_provideronly, imports no SDK, makes no network call and isolates per-source errors; it is not credential discovery and grants no access. Real writes require the existing approval token,confirm=true, the risk/role gate,PEACLOUD_ALLOW_APPLY=true,PEACLOUD_ALLOW_PROVIDER_APPLY=trueand a non-emptyPEACLOUD_PROVIDER_APPLY_SOURCESallowlist. Idempotency is in-process only (not HA-safe, no cloud-side dedupe) and rollback is best-effort inverse actions; there are no autonomous operations, hosted BYOC, signed releases, SOC2, external LLM/RAG service, SSO/SAML/SCIM or production-readiness claims. Phase 14 reconciliation accepts only operator-supplied FOCUS rows with required ISO period dates, prorations use a documented 30-day basis and the local rate card is illustrative, not a cloud price list. Rightsizing acceptance is a plan-only AWS tag handoff and preview verification uses operator-supplied observed states; no real environment is provisioned or destroyed by the module. Cost-proof reports are in-memory and process-local; deployment-local HMAC is an integrity hint, not a signed software release.
cp .env.example .env
docker compose up --build- GUI: http://localhost:5173
- API: http://localhost:8000/api/health
- Prometheus: http://localhost:8000/api/metrics (requires
metrics:read) - OpenAPI: http://localhost:8000/openapi.json
New to PeaCloud? Follow the User Guide for setup, a GUI walkthrough, CLI/API examples, and troubleshooting.
Compose starts Redis, the API, two workers, and the Vite dev server. The bundled environment uses PEACLOUD_DEV_MODE=true so you can select a role/tenant from the GUI. Do not expose this configuration to the internet.
pip install -r requirements.txt
# optional; only needed for Phase 12 Ed25519 bundle signing/verification
pip install -r requirements-trust.txt
uvicorn app.main:app --reload
python -m app.workers.worker
cd frontend && npm ci && npm run dev
PYTHONPATH=. pytest -qIf Redis is unavailable, the queue falls back to in-memory mode (single process only). Set PEACLOUD_REDIS_URL to use a real Redis for cross-process workers.
For real cloud inventory, install the optional SDKs (pip install -r requirements-cloud.txt) and configure PEACLOUD_INVENTORY_SOURCES (see .env.example). With no sources, the four-resource demo inventory is used. Credentials come from each SDK's normal ambient chain (environment, shared config, workload identity, managed identity or kubeconfig) — never from config files or job payloads. Phase 13 provider apply adapters use those same ambient credentials; PeaCloud never reads, stores, exports or invents credentials.
For real costs, point PEACLOUD_COST_FILE at a FOCUS-style JSON array or JSONL export. Without it, PeaCloud generates deterministic demo billing rows from the inventory so the analytics are usable offline. PEACLOUD_BUDGETS adds monthly budgets; jobs at or above PEACLOUD_COST_APPROVAL_THRESHOLD require explicit cost_approved metadata before enqueue.
Self-service quotas come from PEACLOUD_QUOTAS (JSON array, e.g. [{"tenant":"demo","max_environments":5,"max_monthly_usd":200}]). PEACLOUD_WEBHOOK_SECRET is the shared secret used to verify GitHub HMAC-SHA256 and GitLab token webhooks; it must be set before the webhook endpoint will accept requests, and it is never logged. See .env.example for both.
PEACLOUD_APPROVAL_SECRET is the shared secret for MCP/apply approval tokens, bundle attestation and evidence-pack attestation. When empty, a random secret is generated per process; set a stable value in multi-worker deployments so issued tokens verify everywhere. Rotating it invalidates previously issued attestations. The secret is never logged and is never included in evidence packs. PEACLOUD_REQUIRE_ATTESTED_BUNDLES (default false) optionally enforces bundle attestation; leave it off unless attestations are issued in the same deployment. HMAC attestation is deployment-local, not a signed release or third-party signature. Phase 14 reuses this secret for cost-proof report HMAC; no new environment variable is required. PEACLOUD_ALLOW_APPLY (default false) gates mutating apply adapters and must be combined with explicit approval and confirm=true; keep it false unless guarded apply is intended. PEACLOUD_AUDIT_CHAIN_FILE optionally persists the hash-chained audit export to a path; when unset the chain is in-memory only. Generate a CycloneDX-like SBOM with python scripts/generate_sbom.py --output sbom.json (also available as GET /api/sbom). PEACLOUD_SNAPSHOT_FILE optionally persists snapshots to a durable JSON file; when unset, snapshots are in-memory only. PEACLOUD_DRIFT_RULES optionally loads custom drift rule specs from a JSON list; when unset, only the built-in rules are available. PEACLOUD_INTELLIGENCE_SOURCES explicitly lists local text/markdown files with a tenant for each source; no discovery, network fetch or external model call occurs. PEACLOUD_INTELLIGENCE_FILE optionally persists the last offline evaluation result; unset means in-memory.
PEACLOUD_ALLOW_PROVIDER_APPLY (default false) and PEACLOUD_PROVIDER_APPLY_SOURCES (a JSON list of provider kinds such as aws, azure, gcp, kubernetes, or *; unset or empty denies all) are additional gates for real provider writes. Both must be enabled together with PEACLOUD_ALLOW_APPLY=true, an existing valid approval token, confirm=true and the risk/role gate. dry-run remains the default; provider-stub refuses writes and local-log stays in-memory only. Removing a source from the allowlist stops further actions; revoke credentials in the provider IAM to stop their use everywhere (PeaCloud does not detect IAM revocation instantaneously).
PEACLOUD_IDENTITY_PROVIDERS is an optional JSON list of operator-configured identity providers. oidc/saml providers verify a signed JWT produced by your IdP or gateway (raw SAML XML is not parsed and no IdP is contacted); scim providers normalize operator-supplied SCIM-like User records. Group-to-role and tenant mappings are explicit — nothing is inferred from email domains or group names. Federated tokens carry an idp claim naming a configured provider; local JWTs and opt-in dev headers keep their existing behavior. PEACLOUD_IDENTITY_FILE and PEACLOUD_TENANT_FILE optionally persist provisioned users and tenant lifecycle records as tenant-keyed JSON; unset paths remain in-memory. PEACLOUD_COST_PROOF_FILE optionally persists FOCUS reconciliation, preview and case-study records; export is explicit and retention is an audited operator action with no background cleanup. Disabled/deleted tenants are denied at authentication, and tenant delete archives an export before clearing local identity and cost-proof state (append-only audit history is retained). This is self-hostable scaffolding, not hosted BYOC, a complete SAML IdP interoperability certification or production identity provisioning.
migrations/001_init.sql is an offline Postgres/RLS scaffold for tenant-keyed queue, audit, snapshot, cost-proof and identity tables. python scripts/migrate_postgres.py --plan|--sql|--verify only reads and statically verifies the SQL; PeaCloud never opens a database connection or applies it. A guarded --apply path requires an explicitly supplied DSN, --confirm-copy and a locally installed psycopg (not bundled). Test on a copy of live data before any apply; there is no silent production data migration. Until an operator does that, runtime state stays Redis/in-memory/optional JSON files exactly as in earlier phases.
PEACLOUD_SCHEDULER_ENABLED (default false) gates the opt-in scheduler: no thread starts at import and start() only runs a loop when it is truthy. PEACLOUD_SCHEDULE_FILE optionally persists tenant schedules and recorded runs as JSON (in-memory when unset). PEACLOUD_ALERT_FILE optionally appends alerts as JSONL; PEACLOUD_ALERT_WEBHOOKS is an optional JSON list of allowlisted webhook URLs signed with the existing PEACLOUD_APPROVAL_SECRET (no URL means webhook delivery refuses). PEACLOUD_ALERT_SUPPRESSION_SECONDS (default 300) sets the SHA-256 dedupe suppression window; secret fields are stripped from payloads and the in-memory recent-alert buffer is capped at 500.
PEACLOUD_DISCOVERY_SOURCES is an optional JSON list of explicitly configured read-only source definitions (AWS organization roles, Azure subscriptions, GCP projects and Kubernetes contexts); empty means none are configured. Definitions are validated and tenant-scoped, and the discovery plan describes which accounts/projects/contexts would be queried and whether an installed lazy-loaded read adapter supports each. It performs no automatic refresh, invents no credentials, grants no access and makes no provider calls; any later refresh reuses the existing read-only inventory refresh path.
PEACLOUD_TRUST_KEYS is an optional JSON list of public Ed25519 verification key records (kid, public_key_pem, status, optional checksum/source): public keys only, published by kid/fingerprint, never private keys. Rotate by registering the new key before revoking the old one; revocation invalidates verification. PEACLOUD_TRUST_AUTHORITY_URL (optional; https or localhost http) is used only to build an offline fetch plan with pinned checksums — no fetch happens automatically. PEACLOUD_POLICY_ENGINES is an optional JSON list of external engine definitions (name, kind of opa/cedar/custodian, endpoint, enabled); engines are disabled unless enabled: true is explicit, and no request is sent until an explicit evaluate call. Engine URLs allow https hosts and http only on localhost/127.0.0.1. Signing/verification uses cryptography from requirements-trust.txt via a lazy import; without it these operations fail with a clear error. See .env.example.
PeaCloud has two modes:
| Mode | Configuration | How requests authenticate |
|---|---|---|
| Developer preview | PEACLOUD_DEV_MODE=true |
Explicit X-Role and X-Tenant headers (no defaults) |
| Production (local JWT) | PEACLOUD_DEV_MODE=false + PEACLOUD_JWT_SECRET |
Authorization: Bearer <JWT> with claims sub, role, tenant, exp |
| Production (federated) | PEACLOUD_DEV_MODE=false + PEACLOUD_IDENTITY_PROVIDERS |
Authorization: Bearer <JWT> with an idp claim; signature, issuer/audience, tenant and group-to-role mapping come from the configured provider |
Roles: viewer, operator, auditor, admin. Permissions are enforced server-side (resources:read, job:read, job:create, job:cancel, job:retry, metrics:read, worker:status, worker:control, audit:read, tenant:read).
See .env.example for every setting and docs/security/SECURITY_MODEL.md for the threat model.
# dev-header mode
python -m pea --role operator --tenant demo health
python -m pea --role operator --tenant demo handlers
python -m pea --role operator --tenant demo enqueue hash \
--metadata '{"text":"hello","algorithm":"sha256"}' --priority high
python -m pea --role operator --tenant demo jobs --status queued
python -m pea --role operator --tenant demo status
python -m pea --role operator --tenant demo refresh
python -m pea --role operator --tenant demo findings
python -m pea --role operator --tenant demo query "SELECT provider, count(*) AS n FROM resources GROUP BY provider"
python -m pea --role operator --tenant demo cost
python -m pea --role operator --tenant demo budgets
python -m pea --role operator --tenant demo rightsizing
python -m pea --role operator --tenant demo estimate --plan infracost.json
python -m pea --json metricsGlobal flags: --url (PEACLOUD_URL), --token (PEACLOUD_TOKEN), --role (PEACLOUD_ROLE), --tenant (PEACLOUD_TENANT), --json, --verbose. Add --token to switch to production Bearer auth; PeaCloud never invents default credentials.
# self-service (Phase 4)
python -m pea --role operator --tenant demo templates
python -m pea --role operator --tenant demo request-env --template preview-env --input service=api --input branch=main --active 2 --create
python -m pea --role operator --tenant demo workflows
python -m pea --role operator --tenant demo workflow WF_ID
python -m pea --role operator --tenant demo workflow-status WF_ID
python -m pea --role operator --tenant demo approve WF_ID validate-inputs --approver alice
python -m pea --role operator --tenant demo execute-workflow WF_ID # dry-run
python -m pea --role admin --tenant demo execute-workflow WF_ID --apply # admin only; --live disables dry-run
python -m pea --role operator --tenant demo integrations
python -m pea --role operator --tenant demo generate-integration github_actions --spec '{"name":"plan","template":"preview-env"}'
python -m pea --role auditor --tenant demo audit-export --format csv# governed agent surface (Phase 5 core preview)
python -m pea --role operator --tenant demo mcp-tools
python -m pea --role operator --tenant demo mcp-approve create_workflow --arguments '{"name":"review","steps":[{"id":"validate","kind":"discovery","depends_on":[]}]}' --ttl 300
python -m pea --role operator --tenant demo mcp-call create_workflow --arguments '{"name":"review","steps":[{"id":"validate","kind":"discovery","depends_on":[]}]}' --token TOKEN
python -m pea --role operator --tenant demo ask "how many idle resources are there?"
python -m pea --role operator --tenant demo runbooks
python -m pea --role operator --tenant demo propose --evidence '{"finding":"idle"}'
python -m pea --role operator --tenant demo marketplace
python -m pea --role operator --tenant demo install-plan demo-header-plugin
python -m pea --role operator --tenant demo modes
python -m pea --role operator --tenant demo mode local
python -m pea --role operator --tenant demo sbom# guarded apply and audit chain (Phase 6 core preview)
python -m pea --role operator --tenant demo apply-plan tag-idle \
--steps '[{"kind":"tag_resource"}]' --context '{"reason":"weekly cleanup"}'
python -m pea --role operator --tenant demo apply-approve PLAN_ID --ttl 300
python -m pea --role operator --tenant demo apply-confirm PLAN_ID --token TOKEN
python -m pea --role operator --tenant demo apply-execute PLAN_ID --adapter dry-run
python -m pea --role operator --tenant demo apply-status PLAN_ID
python -m pea --role operator --tenant demo apply-plans
python -m pea --role operator --tenant demo apply-adapters
python -m pea --role auditor --tenant demo audit-chain
python -m pea --role auditor --tenant demo audit-chain-verify# drift, ownership and saved views (Phase 7 core preview)
python -m pea --role operator --tenant demo snapshot-create --name baseline
python -m pea --role operator --tenant demo snapshots
python -m pea --role operator --tenant demo snapshot-latest
python -m pea --role operator --tenant demo snapshot SNAPSHOT_ID
python -m pea --role operator --tenant demo snapshot-diff --from FROM_ID --to TO_ID
python -m pea --role operator --tenant demo diff-latest
python -m pea --role operator --tenant demo ownership
python -m pea --role operator --tenant demo ownership-costs
python -m pea --role operator --tenant demo views
python -m pea --role operator --tenant demo view-save prod-ownership --filters '{"provider":"aws","state":"running"}' --description "Running AWS resources"
python -m pea --role operator --tenant demo view-run prod-ownership
python -m pea --role operator --tenant demo view-delete prod-ownership# drift rules and policy bundles (Phase 8 core preview)
python -m pea --role operator --tenant demo drift-rules
python -m pea --role operator --tenant demo drift-check
python -m pea --role operator --tenant demo policy-bundles
python -m pea --role operator --tenant demo policy-bundle baseline-v1
python -m pea --role operator --tenant demo bundle-evaluate baseline-v1
python -m pea --role operator --tenant demo bundle-export baseline-v1
python -m pea --role operator --tenant demo bundle-register --spec "$(cat bundle.json)"
python -m pea --role operator --tenant demo bundle-delete my-bundle# bundle attestation and evidence packs (Phase 9 core preview)
python -m pea --role operator --tenant demo bundle-attest baseline-v1
python -m pea --role operator --tenant demo bundle-apply-attestation baseline-v1 '{"token":"TOKEN"}'
python -m pea --role operator --tenant demo bundle-verify-attestation baseline-v1 TOKEN
python -m pea --role auditor --tenant demo evidence-pack
python -m pea --role auditor --tenant demo evidence-verify --pack "$(cat evidence-pack.json)"# opt-in scheduling and alerts (Phase 10 core preview)
python -m pea --role operator --tenant demo schedules
python -m pea --role operator --tenant demo schedule-create drift_check --interval 3600 --sinks log file --threshold high --description "hourly drift"
python -m pea --role operator --tenant demo schedule SCHEDULE_ID
python -m pea --role operator --tenant demo schedule-enable SCHEDULE_ID
python -m pea --role operator --tenant demo schedule-disable SCHEDULE_ID
python -m pea --role operator --tenant demo scheduler-status
python -m pea --role operator --tenant demo scheduler-tick # manual due-schedule tick
python -m pea --role operator --tenant demo scheduler-start # requires PEACLOUD_SCHEDULER_ENABLED=true
python -m pea --role operator --tenant demo scheduler-stop
python -m pea --role operator --tenant demo alerts
python -m pea --role operator --tenant demo schedule-delete SCHEDULE_ID# resource context and view sharing (Phase 11 core preview)
python -m pea --role operator --tenant demo relationships
python -m pea --role operator --tenant demo rel-neighbors RESOURCE_ID
python -m pea --role operator --tenant demo rel-paths SOURCE_ID TARGET_ID --max-depth 8
python -m pea --role operator --tenant demo rel-cycles
python -m pea --role operator --tenant demo discovery-sources
python -m pea --role operator --tenant demo discovery-source-create NAME KIND --account ACCOUNT_ID
python -m pea --role operator --tenant demo discovery-source-create NAME KIND --subscription SUBSCRIPTION_ID
python -m pea --role operator --tenant demo discovery-source-create NAME KIND --project PROJECT_ID
python -m pea --role operator --tenant demo discovery-source-create NAME KIND --context CONTEXT_NAME
python -m pea --role operator --tenant demo discovery-source-delete NAME
python -m pea --role operator --tenant demo discovery-plan
python -m pea --role operator --tenant demo view-access NAME
python -m pea --role operator --tenant demo view-share NAME --visibility shared --roles operator,auditor
python -m pea --role operator --tenant demo view-claim NAME# signed bundles and external engines (Phase 12 core preview)
python -m pea --role operator --tenant demo trust-keys
python -m pea --role admin --tenant demo trust-key-add KID PEM --status active --checksum SHA256
python -m pea --role admin --tenant demo trust-key-revoke KID
python -m pea --role operator --tenant demo bundle-sign NAME KID PEM
python -m pea --role operator --tenant demo bundle-verify-signature NAME TOKEN
python -m pea --role operator --tenant demo bundle-apply-signature NAME TOKEN
python -m pea --role operator --tenant demo bundle-trust NAME
python -m pea --role auditor --tenant demo authority-plan
python -m pea --role operator --tenant demo engines
python -m pea --role admin --tenant demo engine-add NAME KIND ENDPOINT --enabled
python -m pea --role admin --tenant demo engine-delete NAME
python -m pea --role operator --tenant demo engine-evaluate NAME# credentialed guarded apply (Phase 13 core preview)
python -m pea --role operator --tenant demo provider-capabilities
python -m pea --role operator --tenant demo provider-plan
python -m pea --role operator --tenant demo provider-adapters-register
python -m pea --role operator --tenant demo provider-records
python -m pea --role operator --tenant demo provider-records-clear# cost reconciliation and delivery proof (Phase 14 core preview)
python -m pea --role operator --tenant demo cost-reconcile \
--file /path/to/real-focus-export.csv --format csv \
--source-name billing-account --period-start YYYY-MM-DD --period-end YYYY-MM-DD \
--cost-basis billed --max-variance THRESHOLD
python -m pea --role operator --tenant demo cost-reconciliations
python -m pea --role operator --tenant demo rightsizing-accept RECOMMENDATION_ID --idempotency-key KEY
python -m pea --role operator --tenant demo preview-plan NAME --resources JSON \
--idempotency-key KEY --max-monthly-usd CAP --ttl SECONDS
python -m pea --role operator --tenant demo preview-verify PROOF_ID --states JSON
python -m pea --role operator --tenant demo case-study-publish RECONCILIATION_ID --assumptions JSON
python -m pea --role operator --tenant demo case-studiescost-reconcile exits 0 on a passing gate, 2 on gate failure and 1 on transport/input error. The CLI requires a real FOCUS export supplied by the caller.
PEM values are caller-managed: PeaCloud returns a generated private key only to the caller and never stores it. Avoid placing private keys in shell history. TOKEN is a JSON signature object.
KIND selects the configured source type; use --account, --subscription, --project or --context as appropriate. Relationships and plans are read-only; sharing and claim mutations require job:create.
from pea import PeaCloudClient
with PeaCloudClient(role='operator', tenant='demo') as client:
job = client.enqueue('json_validate', metadata={'text': '{"ok": true}'})
print(client.job(job['id']))
print(client.scheduler_status()) # opt-in scheduling; see client.schedules() / client.alerts()Run python -m pea --help for all commands. Full API reference: docs/api/OPENAPI.md.
GET /api/handlers (or python -m pea handlers) lists every registered job kind with its description, safety flag and example payload.
Built-ins: discovery, inventory-refresh, diagnostic, test-fail, json_validate, json_diff, jwt_decode, hash, uuid, cron_parse, tag_audit, log_redact, cost_estimate, idle_check. All handlers are pure/offline; no destructive cloud operations are enabled.
Metadata is both job metadata and handler input. To preview a job without executing it, set PEACLOUD_DRY_RUN=true on the workers or pass {"dry_run": true} in --metadata.
Add your own handler by dropping a Python module into PEACLOUD_PLUGINS_DIR (default plugins/) that exposes:
from app.handlers import Handler
def register_handlers(registry):
registry.register(Handler(
name='my_handler',
func=lambda payload: {'echo': payload.get('value')},
description='Echoes a value',
))Broken plugins are reported and skipped; they never crash a worker.
- Read-only providers: AWS (EC2/RDS/S3), Azure (VMs), GCP (Compute), Kubernetes (pods/namespaces). Source failures are isolated per provider and reported by
GET /api/inventory/refresh. - Normalized resources: every provider maps to
id,name,provider,type,region,state,tenant,tags,extra,source. - Policy rules:
untagged,publicly_accessible,idle,stale,unowned,unknown_state.POST /api/inventory/refreshre-evaluates them;GET /api/findingslists tenant-scoped findings. Proposed actions always require approval — nothing is executed. - SQL console:
POST /api/queryaccepts a singleSELECT/WITHstatement over the tenant's inventory. Writes, comments and multi-statement input are rejected. Helper functionstag(id, key)andextra(id, path)are available. The GUI has a Query page with example queries.
Explicit, local and read-only — no provider polling. Drift checks remain manual by default; optional scheduled checks are opt-in only.
- Snapshots:
POST /api/snapshotscaptures an immutable, normalized and id-sorted copy of the current tenant inventory.PEACLOUD_SNAPSHOT_FILEpersists snapshots as JSON; unset means in-memory only. - Drift diffs:
POST /api/snapshots/diff(orGET /api/snapshots/diff-latest) reports added/removed/changed resources with field-level changes, counts and severity (highstate;mediumregion/type/provider/tags; otherwiselow). Diffs only compare local snapshots. - Ownership:
GET /api/ownershipgroups resources by case-insensitiveowner,team,cost_centerandenvironmenttags (unassignedwhen absent);GET /api/ownership/costsoptionally correlates with existing tenant costs. - Saved views: allowlisted filters only (
provider,type,region,state,owner,source). Saving/deleting views requiresjob:create; running a view is a read-only inventory filter (resources:read). The GUI has a Drift page for these surfaces.
Explicit, local and read-only — checks are manual by default (opt-in schedules may invoke them) and proposed actions are never executed.
- Drift rules:
GET /api/drift-ruleslists tenant-scoped rules. Built-ins:unexpected-resource-added(high),resource-removed(high),state-changed(high),owner-removed(medium) andregion-changed(medium). Conditions supportresource_added,resource_removed,state_changed,field_changedandtag_removedwith optionalprovider/from/tofilters.POST /api/drift/checkdiffs the latest two snapshots and returns findings plus severity counts; findings are not stored, queued or applied. Custom rules come fromPEACLOUD_DRIFT_RULES(JSON list) or explicit registration. - Policy bundles: declarative JSON specs with
name,version,description,author, a SHA-256 checksum and community trust metadata. Conditions use allowlisted fields (name,provider,type,region,state,source,tags.owner,tags.team,tags.cost_center,tags.environment) and operators (eq,ne,in,not_in,contains,exists). Built-ins:baseline-v1andcost-hygiene-v1. Register viaPOST /api/policy-bundles(job:create), evaluate offline viaPOST /api/policy-bundles/{name}/evaluate, export viaGET /api/policy-bundles/{name}/export(format: peacloud-policy-bundle-v1), and delete viaDELETE /api/policy-bundles/{name}(job:create). No global rule registration, embedded OPA/Cedar execution or finding-store writes; Phase 12 external engines are opt-in service adapters. The GUI has a Policy page for drift checks, bundle evaluation/export and the opt-in engine panel.
Deployment-local, on demand and verifiable offline — not a signed release or certification.
- Bundle attestation:
POST /api/policy-bundles/{name}/attestissues a stateless HMAC token bound to the bundle's canonical content hash (name/version/checksum/rules), issuer, issue/expiry and tierattested(default issuerlocal-admin, TTL 3600s).POST /api/policy-bundles/{name}/apply-attestationtakes{"token": "..."}and records a verified attestation, upgrading bundle trust toattested; invalid tokens are rejected.POST /api/policy-bundles/{name}/verify-attestationchecks a token ({"token": "..."}) and returnsvalid,tierandreason; malformed input does not raise.PEACLOUD_REQUIRE_ATTESTED_BUNDLES(defaultfalse) is the only enforcement gate; attestation is advisory otherwise. - Evidence packs:
GET /api/evidence/packassembles a point-in-timepeacloud-evidence-pack-v1JSON pack from existing local audit-chain, policy bundle, drift rule, snapshot, drift-check and ownership state for the caller's tenant (includenarrows the sections).generated_atis recorded but excluded from the pack's SHA-256content_hash, so identical state hashes identically. With the approval secret configured the pack hasattestation.tier='attested'and an HMAC over format + tenant + content hash; otherwise it isunattestedwith no signature.POST /api/evidence/verifyre-checks format, hash and signature and returns checks/reason without raising. SDK:attest_policy_bundle,apply_policy_bundle_attestation,verify_policy_bundle_attestation,evidence_packandverify_evidence_pack. - Scope: in the Phase 9 base flow HMAC uses a shared secret in this deployment — no third-party trust authorities, external policy engines, provider writes or network calls. Packs contain no secrets and are not collected continuously. This is not SOC2 or any certification and does not imply production readiness. The GUI has an Evidence page for these surfaces.
Opt-in Phase 12 surfaces — bundle signatures only, no signed software and no automatic policy monitoring.
- Public-key bundle signatures: with the optional
cryptographydependency installed,app/trust.pygenerates Ed25519 keypairs (the private key is returned to the caller and never stored by PeaCloud), registers public keys bykid/fingerprint, and signs the existingattestation.content_hashof a bundle. Verification is offline and returns structured checks; a failed signature blocks applying that signature and blocks evaluation whenPEACLOUD_REQUIRE_BUNDLE_TIERraises the gate abovecommunity. Rotate by registering the new key before revoking the old one; revocation invalidates verification. Effective tiers arecommunity(default),attested(deployment-local HMAC) andsigned(Ed25519 public-key), with stale signatures downgrading tocommunity.PEACLOUD_TRUST_AUTHORITY_URLbuilds only an offline fetch plan with pinned checksums — it performs no fetch and is not a certificate authority, third-party endorsement or trust authority service. - External engines:
app/policy_engines.pyis an opt-in registry foropa/cedar/custodianservices configured viaPEACLOUD_POLICY_ENGINES. Engines are disabled by default, require explicit registration andenabled: true, and are contacted only by an explicit evaluate call. Compatibility means calling an external service's API; no engine binary is embedded. Endpoints are allowlisted (https any host, http only localhost/127.0.0.1), responses are size-bounded and findings are normalized deterministically. There is no automatic policy monitoring, and all Phase 12 code is read-only with no provider writes. - Non-claims: these are policy-bundle signatures with locally managed keys — not a signed software release, certificate/CA, third-party endorsement, SOC2 certification or production readiness. Core PeaCloud, including HMAC attestation, works without
cryptography; without it, signing/verification fails with a clear error. - Surfaces: Python SDK methods
trust_keys,register_trust_key,revoke_trust_key,sign_bundle,verify_bundle_signature,apply_bundle_signature,bundle_trust_status,trust_authority_plan,policy_engines,register_policy_engine,delete_policy_engineandevaluate_with_engine; TypeScript SDK methods, trust/key controls on the Evidence page and an engine panel on the Policy page mirror them.
Opt-in automation of existing read-only checks — not continuous compliance monitoring or automatic drift detection in the default product. Checks stay manual unless a schedule is created and a tick or the explicitly started loop runs it.
- Schedules: tenant-scoped
drift_check,inventory_refreshandcost_scanschedules with an interval, severity threshold andlog/file/webhooksinks. Single-flight per tenant/schedule with failure backoff;PEACLOUD_SCHEDULE_FILEoptionally persists schedules and recorded runs (status/duration/summary/error). Replay re-reads recorded runs without re-execution. - Control:
POST /api/scheduler/tick(pea scheduler-tick) processes due schedules as a manual tick. The daemon loop starts only whenPEACLOUD_SCHEDULER_ENABLEDis truthy andstart()is invoked viaPOST /api/scheduler/startorpea scheduler-start;GET /api/scheduler/statusreports loop state, andPOST /api/scheduler/stopstops it. - Alerts: severity-threshold filtered and SHA-256 deduplicated with a
PEACLOUD_ALERT_SUPPRESSION_SECONDSwindow. The file sink appends JSONL toPEACLOUD_ALERT_FILE; the webhook sink posts to URLs allowlisted inPEACLOUD_ALERT_WEBHOOKSwith HMAC-SHA256 signatures reusingPEACLOUD_APPROVAL_SECRET(no URL means no delivery). Secret fields are stripped and the in-memory recent-alert buffer is capped at 500. - Scope: runners reuse the existing read-only functions; no provider writes, no autonomous remediation and no external policy engine. Python SDK:
schedules,create_schedule,schedule,delete_schedule,set_schedule_enabled,schedule_runs,scheduler_status,scheduler_tick,scheduler_start,scheduler_stop,alerts. A frontend Schedule page and a TypeScript SDK expose the same surfaces.
Read-only, tenant-scoped and explicit — no provider writes or network calls from these modules.
- Relationships (heuristic):
GET /api/relationshipsderives a graph on demand from current inventorytags/extraand Kubernetes owner references usingdepends_on,parentand owner-ref markers.GET /api/relationships/neighbors/{resource_id},GET /api/relationships/paths?source=...&target=...(optionalmax_depth) andGET /api/relationships/cyclesquery that graph, including cycle detection. This is a navigation hint, not authoritative topology; the graph is stateless and is not persisted. - Discovery:
PEACLOUD_DISCOVERY_SOURCESdefines an explicit, validated, tenant-scoped registry of AWS organization roles, Azure subscriptions, GCP projects and Kubernetes contexts.GET/POST /api/discovery/sourcesandDELETE /api/discovery/sources/{name}manage definitions;POST /api/discovery/planreports which accounts/projects/contexts would be queried and whether an installed lazy-loaded read adapter supports each. No refresh runs automatically, no credentials are invented and no access is granted. - View sharing: saved views gain
owner,visibility(private/tenant/shared) and a role-gatedshared_withlist.GET /api/views/{name}/accessreports access,POST /api/views/{name}/shareupdates visibility/sharing andPOST /api/views/{name}/claimassigns ownership. Reads are limited to the owner, tenant-visible views or explicitly shared roles; mutations requirejob:create. This is not a public link or a hosted collaboration service. - Surfaces: Python SDK methods are
relationship_graph,relationship_neighbors,relationship_paths,relationship_cycles,discovery_sources,create_discovery_source,delete_discovery_source,discovery_plan,view_access,share_viewandclaim_view. The CLI commands above, a frontend Context page and TypeScript SDK methods mirror them.
- FOCUS ingestion:
PEACLOUD_COST_FILEloads a JSON array or JSONL export into a tenant-scoped store;GET /api/costs/summary,/api/costs/allocation,/api/costs/anomaliesexpose normalized totals and unit costs. - Budgets & approval:
PEACLOUD_BUDGETSdefines monthly limits with warning/breach thresholds.GET /api/budgetsreports status; enqueue returns HTTP 428 unless the estimate is belowPEACLOUD_COST_APPROVAL_THRESHOLDor metadata includescost_approved. - Plan estimates:
POST /api/costs/estimateaccepts Infracost-styleprojects[].breakdown.resources[]or a simpleresources[]plan.pea estimate --plan file.jsonis the CLI equivalent. Nothing is applied. - Rightsizing:
POST /api/rightsizing/refreshevaluates idle/oversized/unattached/stale resources and stores tenant-scoped savings recommendations with approval-requiring proposed actions. - Cost ledger: workers record a deterministic estimate as estimated/actual spend for offline jobs;
GET /api/costs/ledgerand/api/costs/ledger/totalsexpose the history. Real FOCUS ingestion is required for provider-console reconciliation.
app/cost_proof.py turns operator-supplied FOCUS rows into reproducible variance reports and stores delivery-proof records. No FOCUS export, savings figure or provider-console proof is bundled; no costs or savings are invented.
| Capability | Surface | Boundary |
|---|---|---|
| FOCUS reconciliation | POST /api/cost-proof/reconcile |
Only rows supplied by the operator; source.period_start/source.period_end are required ISO dates |
| Reconciliation list | GET /api/cost-proof/reconciliations |
Tenant-scoped reports with content hash and HMAC when configured; optional PEACLOUD_COST_PROOF_FILE persistence |
| Rightsizing acceptance | POST /api/cost-proof/rightsizing/accept |
AWS peacloud:rightsizing=accepted tag plan only; never approves, executes, stops, resizes or deletes |
| Preview plan | POST /api/cost-proof/preview/plan |
Only Phase 13-supported actions; requires peacloud:preview=true, peacloud:owner=<name>, positive max_monthly_usd and ttl_seconds <= 600 |
| Preview verification | POST /api/cost-proof/preview/verify |
Uses operator-supplied observed states; teardown means stopped/terminated/deleted/absent, not proven destruction |
| Case-study publishing | POST /api/cost-proof/case-study |
Requires an existing real reconciliation report and at least one assumption; savings are unclaimed unless an operator supplies a verified figure |
Monthly expected values are linearly prorated to the export period on a documented 30-day basis. Mixed currencies are rejected and a declared source.currency must match the detected currency. Default expected values come from the local rightsizing rate card (explicitly illustrative, not a cloud price list); operator-supplied expected values are accepted and labeled operator-supplied. The gate fails when total variance exceeds the threshold or export resources have no expected value. verify_preview reports delivered_in_time from elapsed wall-clock time between plan creation and verification — not measured provider delivery time. No real environment is provisioned or destroyed by the module.
python -m pea --role operator --tenant demo cost-reconcile \
--file /path/to/real-focus-export.csv --format csv \
--source-name billing-account --period-start YYYY-MM-DD --period-end YYYY-MM-DD \
--cost-basis billed --max-variance THRESHOLD # 0 pass, 2 gate failure, 1 input/transport errorEvery cost-proof API action is captured in the existing hash-chained audit trail. Evidence packs now include a cost_proof section. Every report includes a SHA-256 content_hash; with PEACLOUD_APPROVAL_SECRET configured it also carries a deployment-local HMAC integrity hint — not a signed software release, SOC2 evidence or production readiness. Storage is process-local by default and reports are lost on restart; Phase 15 adds optional PEACLOUD_COST_PROOF_FILE persistence, explicit export and opt-in retention. Resize/delete remain unsupported by the Phase 13 capability matrix. No automatic monitoring, external LLM/RAG service, hosted BYOC, native SSO/SAML/SCIM or design-partner claim is made.
Python SDK methods: reconcile_focus, reconciliations, accept_rightsizing, plan_preview, verify_preview, publish_case_study and case_studies. TypeScript SDK methods reconcileFocus, costReconciliations, acceptRightsizing, planPreview, verifyPreview, publishCaseStudy and costCaseStudies, plus Cost-page panels (FOCUS reconciliation, rightsizing acceptance, reproducible case-study publishing, preview delivery proof), mirror them. CI examples are examples only under examples/ci-cost-gate/; they contain no cost figures and require a real FOCUS export supplied by the runner. See docs/product/COST_CASE_STUDY.md and examples/ci-cost-gate/README.md.
| Method | Path | Permission |
|---|---|---|
| POST | /api/cost-proof/reconcile |
resources:read |
| GET | /api/cost-proof/reconciliations |
resources:read |
| POST | /api/cost-proof/rightsizing/accept |
job:create |
| POST | /api/cost-proof/preview/plan |
job:create |
| POST | /api/cost-proof/preview/verify |
job:create |
| POST | /api/cost-proof/case-study |
job:create |
| GET | /api/cost-proof/case-studies |
resources:read |
| POST | /api/cost-proof/export |
resources:read |
| POST | /api/cost-proof/retention |
job:create |
This phase maps claims that an operator's IdP/gateway has already verified; it is not an IdP, does not parse raw SAML XML and never contacts a SCIM endpoint. oidc/saml providers verify signed JWTs using operator-supplied keys/secrets, issuer and audience; scim providers normalize operator-supplied User records. Tenant and group mappings are explicit, never inferred from email domains or group names. Federated JWTs carry an idp claim; local JWTs and opt-in dev headers keep their existing behavior.
PEACLOUD_IDENTITY_FILE, PEACLOUD_TENANT_FILE and PEACLOUD_COST_PROOF_FILE are optional tenant-keyed JSON stores with atomic writes; unset paths remain process-local. GET /api/persistence/status reports configured paths without exposing values. Disabled/deleted tenants are rejected at authentication; tenant disable/delete archives a deterministic export first, delete requires confirm=true, and the append-only audit chain is retained. migrations/001_init.sql is an offline Postgres/RLS scaffold, statically verified by the API/CLI: PeaCloud never opens a database connection or applies it. An operator apply requires a DSN, --confirm-copy and a local psycopg after testing on a copy of live data; there is no silent production data migration.
| Method | Path | Permission |
|---|---|---|
| GET | /api/identity/providers |
resources:read |
| POST | /api/identity/verify |
resources:read |
| POST | /api/identity/scim/provision |
tenant:read |
| GET | /api/identity/users |
resources:read |
| GET | /api/postgres/migration-plan |
resources:read |
| POST | /api/postgres/migration/verify |
resources:read |
| GET | /api/persistence/status |
resources:read |
| GET | /api/tenants |
tenant:read |
| POST | /api/tenants |
tenant:read |
| POST | /api/tenants/{name}/state |
tenant:read |
| GET | /api/tenants/{name}/export |
tenant:read |
| DELETE | /api/tenants/{name} |
tenant:read |
| GET | /api/rbac/policies |
resources:read |
| POST | /api/rbac/decisions |
resources:read |
Python SDK methods: identity_providers, identity_verify, provision_scim, identity_users, postgres_migration_plan, verify_postgres_migration, persistence_status, tenants, create_tenant, set_tenant_state, export_tenant, delete_tenant, rbac_policies and rbac_decision. CLI commands: identity-providers, identity-verify, scim-provision, identity-users, migration-plan, migration-verify, persistence-status, tenants, tenant-create, tenant-state, tenant-export, tenant-delete, rbac-policies and rbac-decision. The TypeScript SDK and an admin Identity page mirror these surfaces. No hosted BYOC, signed release, SOC2, native IdP integration or production-readiness claim is made.
- Workflows: tenant-scoped DAGs of validated steps with topological levels, approval gates, resume-after-approval, dependency skips and reverse-topological compensation on failure. Execution is dry-run by default;
approved: trueis honoured only foradmin. The default executor calls existing offline handlers (diagnostic,discovery, …) — no provider mutations. - Catalog: built-in
preview-env,sandboxandcost-reviewtemplates render{input.*}values recursively, checkPEACLOUD_QUOTASand produce a plan with approval-required and rollback steps.request_environmentcan create the planned workflow; it never provisions resources. - Integrations: offline generators for GitHub Actions / GitLab CI (
plan → approval → queued apply), allow-listed Terraform/OpenTofuplan/show, validated Pulumi preview, an Argo CD spec with automated sync disabled and a minimal Kubernetes Deployment. GitHub HMAC-SHA256 and GitLab token webhooks are verified withPEACLOUD_WEBHOOK_SECRETand normalized to a small event summary. - SDK:
audit_export,catalog_templates,request_environment,workflows,create_workflow,workflow,workflow_status,approve_step,execute_workflow,integrationsandgenerate_integration.
These are planning/approval surfaces only. Phase 6 adds a guarded apply framework for allowlisted local operations; Phase 13 adds credentialed provider adapters with guarded real writes (see below).
Phase 5 core is deterministic and offline; Phase 16 adds local extractive retrieval over operator-allowlisted documents. No external LLM, network access or provider write is introduced.
- MCP-style tools: twelve built-ins (
inventory_list,findings_list,query_inventory,cost_summary,budget_status,rightsizing_list,estimate_plan,create_workflow,intelligence_sources,intelligence_query,intelligence_evaluate,intelligence_propose) plus explicitly registered custom tools. Ten tools are read-only.create_workflowis allowlisted, requiresjob:createand an HMAC approval token bound to the tool, canonical arguments, tenant, subject and expiry (PEACLOUD_APPROVAL_SECRET); verification is constant-time. Calls without a valid token return HTTP 428 withdetailplusrequirements; tool permission failures return 403. - Ask: tenant-scoped deterministic intents (
inventory_count,inventory_idle,cost_summary,cost_allocation,cost_anomalies,budget_status,rightsizing,unknown). SQL, comments and semicolons are rejected.SUGGESTED_QUESTIONSis available. - Runbooks: four offline runbooks (
idle-resource,untagged-resource,cost-anomaly,rightsizing) with approval-required steps, rollback metadata and a deterministic cost preview. Proposals are unexecuted workflow plans (approval_required: true,executed: false). - Marketplace: validated plugin manifests with deterministic built-ins, constant-time checksum verification and approval-gated offline install plans. Entrypoints are never imported or executed.
- Deployment modes and SBOM:
local,byoc,hostedandmsptemplates; onlylocalis deployment-ready, the rest are roadmap/template-only with documented gaps. The CycloneDX-like SBOM is generated deterministically from requirements and the frontend lockfile.
A frontend Agent page exposes these surfaces; no hosted BYOC tier, signed releases or SOC2 certification exist.
PEACLOUD_INTELLIGENCE_SOURCES is an explicit JSON list of local text/markdown files; each entry must name exactly one tenant and a path. PeaCloud reads only those exact files, never performs discovery or a network/model call, and rejects wildcard tenants. intelligence_query screens for prompt-injection and SQL/command patterns, retrieves only the caller's tenant chunks, redacts secret-like and instruction-like document lines, and returns cited excerpts. Unmatched questions fall back to the deterministic Phase 5 ask engine, so the assistant remains usable without a model.
intelligence_propose requires job:create plus an HMAC approval token bound to the exact arguments. It creates a Phase 6 apply plan with a fingerprint and never executes; the normal approval token, confirm=true, risk/role and Phase 13 adapter gates still apply. Every MCP tool call and approval issuance is appended to the hash-chained audit trail with an argument hash and safe metadata only—never raw prompts, arguments or tokens. POST /api/intelligence/eval/run runs the offline eval/red-team suite, gates release on all cases, and pea intelligence-eval-run exits non-zero when a case fails.
| Method | Path | Permission | Purpose |
|---|---|---|---|
| GET | /api/intelligence/status |
resources:read |
Mode, guardrails, configured sources and last eval |
| GET | /api/intelligence/sources |
resources:read |
Tenant-scoped source descriptors without contents |
| GET | /api/intelligence/tools |
resources:read |
Visible intelligence tool descriptors |
| POST | /api/intelligence/query |
resources:read |
Cited local retrieval or deterministic fallback |
| POST | /api/intelligence/propose |
job:create |
Approval-gated plan-only apply proposal |
| GET | /api/intelligence/eval |
audit:read |
Last offline evaluation result |
| POST | /api/intelligence/eval/run |
audit:read |
Run and record the offline eval gate |
Python SDK methods: intelligence_status, intelligence_sources, intelligence_tools, intelligence_query, intelligence_proposal, issue_intelligence_approval, intelligence_eval and run_intelligence_eval. CLI commands: intelligence-status, intelligence-sources, intelligence-tools, intelligence-query, intelligence-propose, intelligence-proposal-approval, intelligence-eval and intelligence-eval-run. The TypeScript SDK and Agent page mirror these surfaces. No external LLM/RAG service, vector database, autonomous action or production-readiness claim is made.
Tenant-scoped plans and a hash-chained audit export. The built-in adapters do not write to providers; Phase 13 adds separately gated provider-* adapters (see below).
- Plan:
POST /api/apply/plansaccepts{name, steps, context}. Step kinds are allowlisted:tag_resource(low),set_property/start/stop(medium),resize/scale(high),delete(critical). The plan carries a SHA-256 fingerprint of its exact contents. - Approve:
POST /api/apply/approvalsissues an HMAC token signed withPEACLOUD_APPROVAL_SECRET, bound toapply_plan, the exact plan id + fingerprint, tenant, subject and expiry.POST /api/apply/plans/{plan_id}/approverequires that token andconfirm=true; high/critical steps also require theadminrole. - Execute:
POST /api/apply/plans/{plan_id}/executeselects an adapter.dry-run(default) has no side effects;local-logwrites in-memory local records only and needs approval,confirm=trueandPEACLOUD_ALLOW_APPLY=true;provider-stubalways refuses and performs no network/provider SDK calls; Phase 13provider-*adapters are registered explicitly and may write only behind the full gate chain. Failed steps roll back earlier ones in reverse order, and events are emitted vialog_event. - Audit chain:
GET /api/audit/chain,POST /api/audit/chain/verifyandGET /api/audit/chain/exportexpose a tenant-scoped SHA-256 chain, optionally persisted viaPEACLOUD_AUDIT_CHAIN_FILE. Verification detects tampering and secret-like fields are rejected. This is not a compliance certification.
Phase 13 core preview — the first phase that permits real provider writes, only under every gate.
- Read-only expansion:
GET /api/provider-apply/credential-planexpands safe source metadata and Phase 11 discovery sources per tenant, checks adapter availability locally viabuild_provideronly, imports no SDK, makes no network call and isolates per-source errors. It is not credential discovery and grants no access. - Full gate chain: create an apply plan with
context.idempotency_key, issue an HMAC approval token with the existingPEACLOUD_APPROVAL_SECRET, approve withconfirm=true(plus the risk/role gate), then execute with aprovider-*adapter only whenPEACLOUD_ALLOW_APPLY=true,PEACLOUD_ALLOW_PROVIDER_APPLY=trueand a non-emptyPEACLOUD_PROVIDER_APPLY_SOURCESallowlist include the source. Adapters are registered intoapp.apply.adapter_registryonly by an explicitPOST /api/provider-apply/adapters/registercall. - Credentials and redaction: use ambient SDK credentials only (SDK env/shared config/workload identity/managed identity/kubeconfig). PeaCloud never reads, stores, exports or invents credentials; secrets stay out of
PEACLOUD_INVENTORY_SOURCES, plan payloads, logs and exports (redaction strips token/secret/password/key/credential keys). Revocation is performed in provider IAM; removing a source from the allowlist stops further actions. No instantaneous IAM revocation detection is claimed. - Limits: idempotency is an in-process record keyed by
context['idempotency_key']— it is not HA-safe and does not guarantee cloud-side dedupe; real cloud APIs may still have side effects. Rollback is best-effort inverse actions (start↔stop); tag rollback needs prior tags supplied by the caller.resizeanddeleteare unsupported everywhere; Kubernetes is read-only. Every apply is captured in the existing hash-chained audit trail;provider_applyalso keeps a redacted local record list. No autonomous operations.
| Provider | Supported apply actions |
|---|---|
| AWS | tag_resource, start, stop |
| Azure | start, stop |
| GCP | start, stop |
| Kubernetes | none (read-only) |
Python SDK methods are provider_capabilities, provider_credential_plan, register_provider_adapters, provider_apply_records and clear_provider_apply_records; the CLI mirrors them as provider-capabilities, provider-plan, provider-adapters-register, provider-records and provider-records-clear. The Apply page shows a guarded-apply capability/gate panel and the TypeScript SDK exposes the same methods. Phase 10 scheduling stays opt-in, Phase 11 stays heuristic/read-only and Phase 12 signatures stay bundle-only: no hosted BYOC, signed software releases/SBOM signing, SOC2, external LLM/RAG service, SSO/SAML/SCIM, multi-worker HA-safe idempotency, automatic monitoring, production readiness or design partners are shipped.
| Method | Path | Permission |
|---|---|---|
| GET | /api/health |
public |
| GET | /api/handlers |
job:read |
| GET | /api/resources |
resources:read |
| GET | /api/inventory/sources |
resources:read |
| POST | /api/inventory/refresh |
job:create |
| GET | /api/findings |
resources:read |
| GET | /api/policies |
resources:read |
| GET | /api/query/examples |
resources:read |
| POST | /api/query |
resources:read |
| GET | /api/costs/summary |
resources:read |
| GET | /api/costs/allocation |
resources:read |
| GET | /api/costs/anomalies |
resources:read |
| GET | /api/costs/ledger |
resources:read |
| GET | /api/budgets |
resources:read |
| POST | /api/costs/estimate |
resources:read |
| GET | /api/rightsizing |
resources:read |
| POST | /api/rightsizing/refresh |
job:create |
| GET | /api/jobs |
job:read |
| GET | /api/jobs/{id} |
job:read |
| POST | /api/jobs/{kind} |
job:create |
| POST | /api/jobs/{id}/cancel |
job:cancel |
| POST | /api/jobs/{id}/retry |
job:retry |
| GET | /api/worker/status |
worker:status |
| POST | /api/worker/run-one |
worker:control |
| GET | /api/metrics |
metrics:read |
| GET | /api/audit |
audit:read (tenant-filtered) |
| GET | /api/audit/export |
audit:read (JSON/CSV, tenant-filtered) |
| GET | /api/catalog/templates |
resources:read |
| POST | /api/catalog/request |
job:create |
| GET | /api/workflows |
job:read |
| POST | /api/workflows |
job:create |
| GET | /api/workflows/{wid} |
job:read |
| GET | /api/workflows/{wid}/status |
job:read |
| POST | /api/workflows/{wid}/approve |
job:create |
| POST | /api/workflows/{wid}/execute |
job:create (admin only for approved) |
| GET | /api/integrations |
resources:read |
| POST | /api/integrations/generate |
resources:read |
| POST | /api/webhooks/{provider} |
signed webhook (PEACLOUD_WEBHOOK_SECRET) |
| GET | /api/mcp/tools |
resources:read |
| POST | /api/mcp/approvals |
job:create |
| POST | /api/mcp/call |
resources:read (tool permission enforced in server) |
| POST | /api/ask |
resources:read |
| GET | /api/runbooks |
resources:read |
| POST | /api/runbooks/propose |
job:create |
| GET | /api/marketplace |
resources:read |
| POST | /api/marketplace/install-plan |
job:create |
| GET | /api/deployment-modes |
resources:read |
| GET | /api/deployment-modes/{name} |
resources:read |
| GET | /api/sbom |
resources:read |
| POST | /api/apply/plans |
job:create |
| POST | /api/apply/approvals |
job:create |
| POST | /api/apply/plans/{plan_id}/approve |
job:create |
| POST | /api/apply/plans/{plan_id}/execute |
job:create |
| GET | /api/apply/plans/{plan_id} |
job:read |
| GET | /api/apply/plans |
job:read |
| GET | /api/apply/adapters |
job:read |
| GET | /api/provider-apply/capabilities |
resources:read |
| GET | /api/provider-apply/credential-plan |
resources:read |
| POST | /api/provider-apply/adapters/register |
job:create |
| GET | /api/provider-apply/records |
job:read |
| POST | /api/provider-apply/records/clear |
job:create |
| GET | /api/audit/chain |
audit:read |
| POST | /api/audit/chain/verify |
audit:read |
| GET | /api/audit/chain/export |
audit:read |
| POST | /api/snapshots |
resources:read |
| GET | /api/snapshots |
resources:read |
| GET | /api/snapshots/latest |
resources:read |
| GET | /api/snapshots/{snapshot_id} |
resources:read |
| POST | /api/snapshots/diff |
resources:read |
| GET | /api/snapshots/diff-latest |
resources:read |
| GET | /api/ownership |
resources:read |
| GET | /api/ownership/costs |
resources:read |
| GET | /api/views |
resources:read |
| POST | /api/views |
job:create |
| GET | /api/views/{name}/run |
resources:read |
| DELETE | /api/views/{name} |
job:create |
| GET | /api/drift-rules |
resources:read |
| POST | /api/drift/check |
resources:read |
| GET | /api/policy-bundles |
resources:read |
| POST | /api/policy-bundles |
job:create |
| GET | /api/policy-bundles/{name} |
resources:read |
| POST | /api/policy-bundles/{name}/evaluate |
resources:read |
| GET | /api/policy-bundles/{name}/export |
resources:read |
| DELETE | /api/policy-bundles/{name} |
job:create |
| POST | /api/policy-bundles/{name}/attest |
job:create |
| POST | /api/policy-bundles/{name}/apply-attestation |
job:create |
| POST | /api/policy-bundles/{name}/verify-attestation |
resources:read |
| GET | /api/evidence/pack |
resources:read |
| POST | /api/evidence/verify |
resources:read |
| GET | /api/schedules |
job:read |
| POST | /api/schedules |
job:create |
| GET | /api/schedules/{schedule_id} |
job:read |
| DELETE | /api/schedules/{schedule_id} |
job:create |
| POST | /api/schedules/{schedule_id}/enable |
job:create |
| GET | /api/schedules/{schedule_id}/runs |
job:read |
| GET | /api/scheduler/status |
job:read |
| POST | /api/scheduler/tick |
job:create |
| POST | /api/scheduler/start |
job:create |
| POST | /api/scheduler/stop |
job:create |
| GET | /api/alerts |
job:read |
| GET | /api/relationships |
resources:read |
| GET | /api/relationships/neighbors/{resource_id} |
resources:read |
| GET | /api/relationships/paths |
resources:read |
| GET | /api/relationships/cycles |
resources:read |
| GET | /api/discovery/sources |
resources:read |
| POST | /api/discovery/sources |
job:create |
| DELETE | /api/discovery/sources/{name} |
job:create |
| POST | /api/discovery/plan |
resources:read |
| GET | /api/views/{name}/access |
resources:read |
| POST | /api/views/{name}/share |
job:create |
| POST | /api/views/{name}/claim |
job:create |
| GET | /api/trust/keys |
resources:read |
| POST | /api/trust/keys |
job:create |
| POST | /api/trust/keys/{kid}/revoke |
job:create |
| POST | /api/trust/bundles/{name}/sign |
job:create |
| POST | /api/trust/bundles/{name}/verify |
resources:read |
| POST | /api/trust/bundles/{name}/apply |
job:create |
| GET | /api/trust/bundles/{name}/status |
resources:read |
| POST | /api/trust/authority/fetch-plan |
resources:read |
| GET | /api/policy-engines |
resources:read |
| POST | /api/policy-engines |
job:create |
| DELETE | /api/policy-engines/{name} |
job:create |
| POST | /api/policy-engines/{name}/evaluate |
job:create |
| POST | /api/cost-proof/reconcile |
resources:read |
| GET | /api/cost-proof/reconciliations |
resources:read |
| POST | /api/cost-proof/rightsizing/accept |
job:create |
| POST | /api/cost-proof/preview/plan |
job:create |
| POST | /api/cost-proof/preview/verify |
job:create |
| POST | /api/cost-proof/case-study |
job:create |
| GET | /api/cost-proof/case-studies |
resources:read |
Jobs support priority (low/normal/high), metadata, max_attempts (1–10), idempotency keys, retry backoff, cancellation, and a dead-letter queue.
The phased plan is in docs/product/ROADMAP.md: foundation → developer surface → real inventory → cost awareness → self-service → governed AI → guarded apply and durable audit → drift, ownership and saved views → manual drift checks and declarative policy bundles → deployment-local bundle attestation and offline evidence packs → opt-in scheduling and severity-filtered alerts → heuristic resource context with read-only discovery plans and role-gated view sharing → opt-in public-key signed policy bundles with trust tiers and opt-in external policy-engine adapters → credentialed provider adapters and guarded real apply → operator-supplied FOCUS cost reconciliation and plan-only delivery proof → explicit identity-claim mapping, opt-in persistence and tenant lifecycle scaffolding → governed local document retrieval with approval-gated proposals and offline eval gates.
MIT — see LICENSE.