Audience: Platform engineers, SREs, DevOps teams, and infrastructure architects deploying SWT3 infrastructure witnessing via IaC pipelines. Assumes familiarity with Terraform or OpenTofu, cloud provider IAM, and container registries.

Terraform or OpenTofu -- your choice. Every HCL example in this guide works identically with terraform and tofu. We test against both. Where the commands differ (binary name only), we show both. The SWT3 protocol has no dependency on either tool's license or distribution model. Use whichever your organization has standardized on.

What You Get

The SWT3 Infrastructure Witness is a 9MB static Go binary that reads cloud audit events (CloudTrail, Azure Activity Log, GCP Cloud Audit Logs, or any OCSF-normalized source), extracts 6 canonical fields, computes a deterministic SHA-256 hash, and sends only the hash plus a human-readable summary to the SWT3 witness endpoint. Your raw audit data never leaves your environment.

Infrastructure anchors land in the same witness ledger and daily Merkle commitment as your AI inference anchors. A single membership proof can verify that a specific AI model decision and a specific infrastructure change coexisted in the same cryptographic commitment. No other system on the market produces this proof.

ComponentWhat it doesWhere it runs
swt3-infra-witnessParses cloud audit events, hashes canonical fields, witnesses to SWT3Your cloud account (ECS Fargate, Cloud Run, Container Instances, K8s, or bare metal)
IaC moduleProvisions the witness binary + event pipeline + IAM + secretsYour Terraform/OpenTofu state
SWT3 APIRe-derives fingerprint, verifies hash, mints anchor, includes in Merkle treeSWT3 platform (sovereign.tenova.io)
Zero runtime dependencies. The binary uses only Go standard library. No external modules. The container image is ~7MB (distroless base + static binary). The fingerprint formula is locked and verified against cross-language test vectors across 7 languages.

Prerequisites

  1. Terraform >= 1.5 or OpenTofu >= 1.6 -- both parse identical HCL
  2. SWT3 API key -- sign up free to get an axm_open_* key, or use your existing axm_live_* key
  3. Cloud provider CLI authenticated (aws, az, or gcloud)
  4. Container registry access -- the witness image is published to GHCR: ghcr.io/tenova-labs/swt3-witness:latest
# Verify your IaC tool
terraform version   # or: tofu version
# Both should show >= 1.5 / 1.6

# Verify your API key works
curl -s -H "Authorization: Bearer $SWT3_API_KEY" \
  https://sovereign.tenova.io/api/v1/health | jq .status
# Expected: "healthy"

Local-First: Docker Compose Dev Environment

Before deploying to any cloud, validate the full pipeline locally. The dev environment includes a mock witness receiver that returns SWT3-MOCK- prefixed anchors -- no API key needed, no cloud credentials needed.

# Clone and start the dev environment
git clone https://github.com/tenova-labs/swt3-infra-witness
cd swt3-infra-witness

# Start all 3 services (mock-receiver + witness + event-generator)
docker compose -f docker-compose.dev.yml up

# In another terminal, check health
curl -s http://localhost:8080/healthz | jq .

# Watch events being witnessed in real-time
# The event-generator POSTs sample CloudTrail, Azure, and GCP events every 3 seconds
# You'll see mock anchors in the witness logs

Once you see events flowing through the mock pipeline, you know the binary works. Now deploy it for real.

Mock keys are rejected in production. The dev environment uses swt3_dev_REPLACE_ME as the API key. The production SWT3 endpoint rejects any key with a dev_ or REPLACE prefix. You must use a real axm_* key for production deployment.

Architecture: What the Module Provisions

Each deployment follows the same pattern: an event source feeds audit logs to the witness binary, which hashes canonical fields and POSTs fingerprints to the SWT3 API. The binary runs in server mode (--mode server) inside the cheapest container option available on each cloud. The HCL examples below are complete and self-contained -- copy them into your repo and adjust the variables.

Cloud Audit Log (CloudTrail / Activity Log / Cloud Audit)
    |
    v
Event Queue (SQS / Event Grid / Pub/Sub)
    |
    v
Witness Binary (ECS Fargate / Container Instance / Cloud Run)
    |-- Parse audit event (auto-detect format)
    |-- Extract 6 canonical fields
    |-- SHA-256 hash (deterministic, cloud-agnostic)
    |-- POST hash + summary to SWT3 API
    v
SWT3 Witness Ledger + Daily Merkle Tree
    |
    (Same tree as AI inference anchors)
CloudComputeEvent SourceSecret StoreEstimated Cost
AWSECS FargateCloudTrail -> EventBridge -> HTTPSecrets Manager~$3-8/mo at 10K events/day
AzureContainer InstancesActivity Log -> Event Grid -> HTTPKey Vault~$3-8/mo at 10K events/day
GCPCloud RunCloud Audit -> Pub/Sub -> HTTPSecret Manager~$1-4/mo at 10K events/day

AWS: ECS Fargate + SQS + CloudTrail

This configuration runs the witness binary as an ECS Fargate task in server mode, receiving CloudTrail events forwarded via EventBridge and SQS. CloudTrail is enabled by default in every AWS account, so this works with your existing trail -- no new logging infrastructure required.

HCL Configuration

# main.tf -- SWT3 Infrastructure Witness on AWS
# Copy this into your repo. Works with terraform >= 1.5 or tofu >= 1.6.

terraform {
  required_version = ">= 1.5"
  required_providers {
    aws = { source = "hashicorp/aws", version = "~> 5.0" }
  }
}

variable "swt3_api_key_secret_arn" {
  description = "ARN of the Secrets Manager secret containing the SWT3 API key"
  type        = string
}

variable "clearing_level" {
  description = "Clearing level: 0=Analytics, 1=Standard, 2=Sensitive, 3=Classified"
  type        = number
  default     = 1
}

variable "agent_id" {
  description = "Identity of this witness instance in the ledger"
  type        = string
  default     = "aws-witness"
}

# --- ECS Cluster + Fargate Service ---

resource "aws_ecs_cluster" "witness" {
  name = "swt3-witness"
}

resource "aws_ecs_task_definition" "witness" {
  family                   = "swt3-witness"
  requires_compatibilities = ["FARGATE"]
  network_mode             = "awsvpc"
  cpu                      = "256"
  memory                   = "512"
  execution_role_arn       = aws_iam_role.witness_exec.arn
  task_role_arn            = aws_iam_role.witness_task.arn

  container_definitions = jsonencode([{
    name  = "swt3-witness"
    image = "ghcr.io/tenova-labs/swt3-witness:latest"

    command = ["--mode", "server", "--port", "8080", "--format", "auto"]

    portMappings = [{ containerPort = 8080, protocol = "tcp" }]

    secrets = [{
      name      = "SWT3_API_KEY"
      valueFrom = var.swt3_api_key_secret_arn
    }]

    environment = [
      { name = "SWT3_CLEARING_LEVEL", value = tostring(var.clearing_level) },
      { name = "SWT3_AGENT_ID",       value = var.agent_id },
    ]

    logConfiguration = {
      logDriver = "awslogs"
      options = {
        awslogs-group         = aws_cloudwatch_log_group.witness.name
        awslogs-region        = data.aws_region.current.name
        awslogs-stream-prefix = "witness"
      }
    }
  }])
}

resource "aws_cloudwatch_log_group" "witness" {
  name              = "/ecs/swt3-witness"
  retention_in_days = 14
}

data "aws_region" "current" {}

# --- IAM: Execution Role (pull image + read secrets) ---

resource "aws_iam_role" "witness_exec" {
  name = "swt3-witness-exec"
  assume_role_policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{ Effect = "Allow", Principal = { Service = "ecs-tasks.amazonaws.com" }, Action = "sts:AssumeRole" }]
  })
}

resource "aws_iam_role_policy_attachment" "witness_exec_ecr" {
  role       = aws_iam_role.witness_exec.name
  policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
}

resource "aws_iam_role_policy" "witness_exec_secrets" {
  name = "swt3-read-secret"
  role = aws_iam_role.witness_exec.name
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect   = "Allow"
      Action   = ["secretsmanager:GetSecretValue"]
      Resource = [var.swt3_api_key_secret_arn]
    }]
  })
}

# --- IAM: Task Role (minimal -- no AWS API access needed) ---

resource "aws_iam_role" "witness_task" {
  name = "swt3-witness-task"
  assume_role_policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{ Effect = "Allow", Principal = { Service = "ecs-tasks.amazonaws.com" }, Action = "sts:AssumeRole" }]
  })
}

# --- ECS Service (runs the task) ---

# NOTE: You must supply your own VPC subnet IDs and security group.
# The security group needs egress to HTTPS (port 443) for the SWT3 endpoint.
# No ingress rules are required unless you route events via HTTP (EventBridge).

variable "subnet_ids" {
  description = "Private subnet IDs for the Fargate task"
  type        = list(string)
}

variable "security_group_id" {
  description = "Security group allowing HTTPS egress"
  type        = string
}

resource "aws_ecs_service" "witness" {
  name            = "swt3-witness"
  cluster         = aws_ecs_cluster.witness.id
  task_definition = aws_ecs_task_definition.witness.arn
  desired_count   = 1
  launch_type     = "FARGATE"

  network_configuration {
    subnets         = var.subnet_ids
    security_groups = [var.security_group_id]
    assign_public_ip = false  # Use NAT Gateway for outbound
  }
}

# Store your API key in Secrets Manager (do this once via CLI, not in state)
# aws secretsmanager put-secret-value --secret-id swt3/api-key --secret-string "axm_live_..."

output "cluster_name" { value = aws_ecs_cluster.witness.name }
output "service_name" { value = aws_ecs_service.witness.name }
Why ECS Fargate, not Lambda? The witness binary runs in long-lived server mode (--mode server), receiving events via HTTP POST. A native Lambda handler mode is on the roadmap (Phase 2). For now, ECS Fargate gives you a persistent HTTP endpoint with the same container image, auto-restart, and CloudWatch integration. For batch/one-shot processing, use the binary's CLI mode (--mode cli) directly in your CI/CD pipeline instead.

What This Creates

To feed CloudTrail events to the witness, add an EventBridge rule that matches CloudTrail API calls and targets the ECS task's HTTP endpoint, or use the CLI mode in a scheduled task that reads from your CloudTrail S3 bucket.

Deploy

# First, store your API key (only need to do this once)
aws secretsmanager put-secret-value \
  --secret-id swt3/api-key \
  --secret-string "axm_live_YOUR_KEY_HERE"

# Initialize and apply
terraform init    # or: tofu init
terraform plan    # or: tofu plan
terraform apply   # or: tofu apply
Existing CloudTrail, no changes needed. The witness reads CloudTrail events delivered to it -- it does not create a new trail, modify your trail configuration, or require direct S3 access. Your existing SIEM, security tooling, and access patterns are unaffected.

Azure: Container Instances + Activity Log

The Azure module runs the witness binary as an Azure Container Instance, receiving Activity Log events via Event Grid. Azure Activity Log captures all ARM (Azure Resource Manager) operations by default.

HCL Configuration

# main.tf -- SWT3 Infrastructure Witness on Azure
terraform {
  required_version = ">= 1.5"
  required_providers {
    azurerm = { source = "hashicorp/azurerm", version = "~> 4.0" }
  }
}

provider "azurerm" { features {} }

variable "clearing_level" { default = 1 }
variable "agent_id"       { default = "azure-witness" }

resource "azurerm_resource_group" "witness" {
  name     = "rg-swt3-witness"
  location = "eastus2"
}

resource "azurerm_container_group" "witness" {
  name                = "swt3-witness"
  location            = azurerm_resource_group.witness.location
  resource_group_name = azurerm_resource_group.witness.name
  os_type             = "Linux"
  restart_policy      = "Always"

  identity {
    type = "SystemAssigned"
  }

  container {
    name   = "swt3-witness"
    image  = "ghcr.io/tenova-labs/swt3-witness:latest"
    cpu    = 0.5
    memory = 0.5

    commands = ["/swt3-infra-witness", "--mode", "server", "--port", "8080", "--format", "auto"]

    ports { port = 8080; protocol = "TCP" }

    environment_variables = {
      SWT3_CLEARING_LEVEL = tostring(var.clearing_level)
      SWT3_AGENT_ID       = var.agent_id
    }

    # Pass the API key as a sensitive variable (never hardcode).
    # Option A: Use TF_VAR_swt3_api_key (masked in CI)
    # Option B: Reference Key Vault via the managed identity at runtime
    secure_environment_variables = {
      SWT3_API_KEY = var.swt3_api_key
    }
  }
}

variable "swt3_api_key" {
  description = "SWT3 API key -- pass via TF_VAR_swt3_api_key, never hardcode"
  type        = string
  sensitive   = true
}

# For production with Key Vault, replace secure_environment_variables with
# a runtime secret fetch. Store the key first:
# az keyvault secret set --vault-name kv-swt3 --name swt3-api-key --value "axm_live_..."

output "container_ip" {
  value = azurerm_container_group.witness.ip_address
}

What This Creates

To feed Activity Log events to the witness, create an Event Grid subscription that routes to the container's HTTP endpoint, or use the CLI mode with az monitor activity-log list --output json piped to the binary.

Deploy

# Store the API key in Key Vault
az keyvault secret set \
  --vault-name kv-swt3-witness \
  --name swt3-api-key \
  --value "axm_live_YOUR_KEY_HERE"

# Deploy
terraform init && terraform apply
# or: tofu init && tofu apply

# Verify
az container show --resource-group rg-swt3-witness \
  --name swt3-witness --query "instanceView.state"
# Expected: "Running"

GCP: Cloud Run + Cloud Audit Logs

The GCP module deploys the witness binary as a Cloud Run service, receiving Cloud Audit Log events via Pub/Sub push subscription. GCP Cloud Audit Logs (Admin Activity) are enabled by default and cannot be disabled.

HCL Configuration

# main.tf -- SWT3 Infrastructure Witness on GCP
terraform {
  required_version = ">= 1.5"
  required_providers {
    google = { source = "hashicorp/google", version = "~> 6.0" }
  }
}

variable "project_id"     { type = string }
variable "region"         { default = "us-central1" }
variable "clearing_level" { default = 1 }
variable "agent_id"       { default = "gcp-witness" }

resource "google_cloud_run_v2_service" "witness" {
  name     = "swt3-witness"
  location = var.region

  template {
    scaling {
      min_instance_count = 0  # Scale to zero when idle
      max_instance_count = 3
    }

    containers {
      image   = "ghcr.io/tenova-labs/swt3-witness:latest"
      args    = ["--mode", "server", "--port", "8080", "--format", "auto"]

      ports { container_port = 8080 }

      env { name = "SWT3_CLEARING_LEVEL"; value = tostring(var.clearing_level) }
      env { name = "SWT3_AGENT_ID";       value = var.agent_id }

      # Reference the secret from Secret Manager
      env {
        name = "SWT3_API_KEY"
        value_source {
          secret_key_ref {
            secret  = google_secret_manager_secret.swt3_key.secret_id
            version = "latest"
          }
        }
      }

      resources {
        limits = { cpu = "1", memory = "512Mi" }
      }
    }

    service_account = google_service_account.witness.email
  }
}

resource "google_secret_manager_secret" "swt3_key" {
  secret_id = "swt3-api-key"
  replication { auto {} }
}

# Store the secret value via CLI, not in state:
# echo -n "axm_live_..." | gcloud secrets versions add swt3-api-key --data-file=-

resource "google_service_account" "witness" {
  account_id   = "swt3-witness"
  display_name = "SWT3 Witness"
}

# Grant the service account access to read the secret
resource "google_secret_manager_secret_iam_member" "witness_access" {
  secret_id = google_secret_manager_secret.swt3_key.id
  role      = "roles/secretmanager.secretAccessor"
  member    = "serviceAccount:${google_service_account.witness.email}"
}

output "service_url" { value = google_cloud_run_v2_service.witness.uri }

What This Creates

To feed Cloud Audit Log events to the witness, create a Pub/Sub topic with a log sink filter and a push subscription targeting the Cloud Run URL, or use the CLI mode with gcloud logging read piped to the binary.

Deploy

# Store the API key
echo -n "axm_live_YOUR_KEY_HERE" | gcloud secrets versions add swt3-api-key --data-file=-

# Deploy
terraform init && terraform apply
# or: tofu init && tofu apply

# Verify
gcloud run services describe swt3-witness --region us-central1 \
  --format "value(status.conditions[0].status)"
# Expected: "True"
GCP Cloud Run scales to zero. With min_instances = 0, you pay nothing when no audit events are flowing. The first event triggers a cold start (~2 seconds for a 7MB container). For latency-sensitive environments, set min_instances = 1 to keep one instance warm.

Secrets Management (All Clouds)

The SWT3 API key is the only secret required. It must never appear in your Terraform state, HCL files, or version control.

The Pattern

  1. Create the secret via CLI (not Terraform) -- the secret value stays out of state
  2. Reference the secret ARN/name in your module -- Terraform knows where the secret lives, not what it contains
  3. Binary reads at runtime -- the Lambda/container fetches the secret on cold start, caches in memory
CloudSecret StoreCreate CommandModule Parameter
AWSSecrets Manageraws secretsmanager put-secret-value --secret-id swt3/api-key --secret-string "axm_..."swt3_api_key_secret_arn
AzureKey Vaultaz keyvault secret set --vault-name kv-swt3 --name swt3-api-key --value "axm_..."swt3_api_key_secret
GCPSecret Managerecho -n "axm_..." | gcloud secrets versions add swt3-api-key --data-file=-swt3_api_key_secret
Never put secret values in Terraform variables files or CI environment variables that get logged. Use your cloud's secret store CLI to set the value, then reference only the ARN or name in HCL. If you must pass the key via TF_VAR_, ensure your CI system masks the variable and does not print plan output that includes the value.

Optional: HMAC Signing Key

For payload signing (HMAC-SHA256), store a second secret in the same vault and pass its ARN/name via the signing_key_arn or signing_key_secret parameter. The binary uses this to sign each witness payload, providing tamper evidence between your environment and the SWT3 API.

Clearing Levels in IaC

The clearing_level variable controls how much detail survives in the witness ledger. This is a data minimization control -- higher levels retain less human-readable information while preserving the cryptographic proof.

LevelNameWhat's RetainedWhat's ClearedUse Case
0AnalyticsFull summary, all 6 canonical fieldsNothingDev/staging, internal audit
1StandardFull summary, actor hashed in observationsRaw actor identityProduction (default)
2SensitiveOperation + status onlyActor, resource ARN/IDRegulated data, GDPR
3ClassifiedCanonical hash onlyEverything human-readableDefense, air-gapped environments
# Set clearing level per environment using Terraform workspaces or tfvars

# staging.tfvars
# clearing_level = 0    # Full detail in staging
# agent_id       = "staging-witness"

# production.tfvars
# clearing_level = 1    # Actor hashed in production (default)
# agent_id       = "prod-witness"

# regulated.tfvars
# clearing_level = 2    # Minimal detail for regulated workloads
# agent_id       = "regulated-witness"

# Deploy per environment:
# terraform apply -var-file=staging.tfvars
# terraform apply -var-file=production.tfvars
# terraform apply -var-file=regulated.tfvars
Clearing levels are irreversible. Once the witness binary clears fields before sending, the cleared data is never transmitted to SWT3. The cryptographic proof (hash) remains valid at all clearing levels -- a Level 3 anchor is just as verifiable as a Level 0 anchor, it simply cannot be decoded back to human-readable fields.

CI/CD Pipeline Integration

The IaC modules deploy the persistent witness infrastructure. For CI/CD pipelines that also need to witness infrastructure changes at deploy time, use the CLI mode directly:

GitHub Actions

# .github/workflows/deploy.yml
name: Deploy Infrastructure
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Terraform Apply
        run: |
          terraform init
          terraform apply -auto-approve

      - name: Witness Infrastructure Changes
        env:
          SWT3_API_KEY: ${{ secrets.SWT3_API_KEY }}
        run: |
          # Build the witness binary from source (zero deps, ~5s)
          git clone --depth 1 https://github.com/tenova-labs/swt3-infra-witness /tmp/swt3-iw
          cd /tmp/swt3-iw
          CGO_ENABLED=0 go build -o swt3-infra-witness ./cmd/swt3-infra-witness/

          # Witness the CloudTrail events generated by this deploy
          aws cloudtrail lookup-events \
            --lookup-attributes AttributeKey=EventSource,AttributeValue=ec2.amazonaws.com \
            --start-time $(date -u -d '10 minutes ago' +%Y-%m-%dT%H:%M:%SZ) \
            --output json | ./swt3-infra-witness --format cloudtrail

GitLab CI

# .gitlab-ci.yml
deploy:
  stage: deploy
  image: golang:1.24
  script:
    - tofu init && tofu apply -auto-approve
    - |
      git clone --depth 1 https://github.com/tenova-labs/swt3-infra-witness /tmp/swt3-iw
      cd /tmp/swt3-iw
      CGO_ENABLED=0 go build -o swt3-infra-witness ./cmd/swt3-infra-witness/
      aws cloudtrail lookup-events \
        --lookup-attributes AttributeKey=EventSource,AttributeValue=ec2.amazonaws.com \
        --start-time $(date -u -d '10 minutes ago' +%Y-%m-%dT%H:%M:%SZ) \
        --output json | ./swt3-infra-witness --format cloudtrail
  variables:
    SWT3_API_KEY: $SWT3_API_KEY

Post-Deploy Validation

After deploying the module, verify the pipeline end-to-end:

# 1. Check the witness binary health
#    AWS: check ECS service status and CloudWatch logs
#    Azure: curl the container's IP on port 8080/healthz
#    GCP: curl the Cloud Run service URL /healthz

# 2. Generate a test infrastructure event
aws ec2 describe-instances --max-results 1 > /dev/null
# This creates a DescribeInstances CloudTrail event

# 3. Wait 2-5 minutes for CloudTrail delivery (CloudTrail has ~5 min lag)

# 4. Check the SWT3 ledger for your anchor
curl -s -H "Authorization: Bearer $SWT3_API_KEY" \
  "https://sovereign.tenova.io/api/v1/witness?procedure=INF-OCSF.1&limit=5" | jq .

# 5. Verify the anchor
# Copy the anchor token from the response, then:
curl -s "https://sovereign.tenova.io/verify?token=SWT3-E-..." | head -20
Dry-run mode for validation. If you want to verify parsing and hashing without sending to the SWT3 API, use --dry-run with the CLI binary. This processes the events, shows the extracted fields and computed hashes, but does not POST anything. Useful for validating that your CloudTrail format is being parsed correctly.

Multi-Cloud Unified Tree

Deploy the module to multiple clouds. All infrastructure anchors land in the same tenant's witness ledger, regardless of which cloud produced them. The daily Merkle root covers every anchor -- AWS, Azure, GCP, and AI inference -- in a single cryptographic commitment.

# Multi-cloud deployment structure
# Each cloud gets its own directory with the HCL from the sections above.
# All use the same SWT3 API key (same tenant).
#
# infra/
#   aws/
#     main.tf       # ECS Fargate config (agent_id = "aws-prod")
#   azure/
#     main.tf       # Container Instance config (agent_id = "azure-prod")
#   gcp/
#     main.tf       # Cloud Run config (agent_id = "gcp-prod")
#
# Each witness instance identifies itself via agent_id.
# The SWT3 ledger records which agent produced each anchor.

Each witness instance identifies itself via agent_id. The SWT3 ledger records which agent produced each anchor, so you can filter by cloud when querying. But the Merkle tree does not care -- AWS and GCP anchors are peers in the same tree.

QueryWhat You Get
?procedure=INF-OCSF.1&agent_id=aws-prodOnly AWS infrastructure anchors
?procedure=INF-OCSF.1All infrastructure anchors (all clouds)
?procedure=AI-INF.1AI inference anchors (from SDK)
Merkle proof for any anchorProof spans both AI and infrastructure domains

Scope and Limitations

Honest scope. The infrastructure witness records what happened (evidence). It does not enforce what should happen (policy).

What this covers

What this does NOT cover

Kubernetes teams: consider the Helm chart. If your primary deployment target is Kubernetes, the SWT3 Witness Helm chart (helm pull oci://ghcr.io/tenova-labs/charts/swt3-witness) may be a better fit than Terraform for the witness itself. Use Terraform for the surrounding infrastructure (VPC, cluster, secrets) and Helm for the witness workload. The two approaches are complementary.

Troubleshooting

Events not appearing in the ledger

  1. Check the API key prefix. Must be axm_open_* or axm_live_*. Keys with dev_ or REPLACE are rejected.
  2. Check CloudTrail delivery lag. AWS CloudTrail delivers logs to S3 with a 5-15 minute delay. This is an AWS limitation, not SWT3.
  3. Check the dead-letter queue (AWS). Failed events land in the DLQ after 3 retries. Non-zero DLQ depth means events are failing to process.
  4. Check container logs. The binary prints "WARNING: Non-production API key detected" on startup if the key is invalid.

ECS task unhealthy (AWS)

If the ECS task keeps restarting, check CloudWatch logs for startup errors. Common cause: the Secrets Manager ARN is wrong or the execution role lacks secretsmanager:GetSecretValue permission. Also verify the task has outbound internet access (required for the SWT3 endpoint) -- tasks in private subnets need a NAT Gateway.

Permission denied on secrets

The module creates least-privilege IAM roles/policies, but if your organization has SCPs (AWS), Azure Policy, or Org Policies (GCP) that restrict secret access, the module's IAM may be insufficient. Check your organization's guardrails and add exceptions for the witness role if needed.

Duplicate anchors

The SWT3 API is idempotent. If the same canonical hash is submitted twice, the second submission receives the existing anchor instead of creating a duplicate. The binary also maintains a local cursor file (.swt3-infra-cursor.json) for client-side deduplication across restarts.

For the full SRE troubleshooting reference, see the SRE Runbook.

Get Your API Key

Free tier includes 1,000 witness anchors per month. No credit card required.

Create Free Account