ClearGlassInc Artemis · Palantir full-stack implementation blueprint

Self-evolving AI intelligence, governed at mission speed.

This design is a production-grade reference architecture for ClearGlassInc Artemis built around Palantir Gotham, Foundry, AIP, and Apollo. The system fuses live and historical data, reasons over an ontology, learns from operator feedback, and proposes upgrades to prompts, workflows, heuristics, and model routing — but only inside explicit human-approved guardrails.

Desmond Otieno Odhiambo · 2026-07-24 · 24 min read

Artemis luminous systems bus

Governance interlock online
Energy profileStabilized core
Decision boundaryHuman
Audit planeAppend-only
Runtime postureObserved
Dark ClearGlass Inc. APT Threat Tracker command console showing active threat actors, sector targeting, threat score, and recent MITRE ATT&CK techniques
Interface concept: the ClearGlassInc Artemis analyst surface translates governed ontology objects into an operational threat picture. Displayed metrics are illustrative design data, not live intelligence or operational status.

Operating invariant

AI may recommend, draft, simulate, evaluate, and prepare action packages. It may not change mission objectives, permissions, production systems, coalition release markings, or operational actions without accountable human approval and immutable audit evidence.

Palantir terminology

Gotham anchors investigations and entity tracking. Foundry integrates data and ontology-backed applications. AIP hosts copilots, agents, tools, and evals. Apollo controls deployment, rollout, rollback, and runtime configuration.

System Architecture

End-to-end ClearGlassInc Artemis platform

Frontend

Analyst workbench, commander cockpit, investigation graph, mission timeline, alert triage queue, approval board, model-eval dashboard, prompt diff reviewer, and Apollo release console.

Backend

Python FastAPI gateway, mission service, case service, ontology query adapter, agent tool broker, approval workflow service, policy decision point, feedback service, eval builder, and append-only audit writer.

Data layer

Streaming bus for live events, Foundry bronze/silver/gold pipelines, governed lakehouse tables, search index, vector retrieval, graph projections, feature store, and bitemporal lineage tables.

AI orchestration

AIP-style model router, prompt registry, tool-scoped agents, state-machine workflows, eval harness, red-team simulator, confidence calibration, and self-upgrade proposal generator.

Policy layer

Need-to-know ABAC, row/column/entity filters, coalition releasability, purpose-of-use, tool capability scopes, risk scoring, approval gates, and policy-as-code regression tests.

Observability and deployment

OpenTelemetry traces, privacy-aware logs, eval metrics, drift alarms, SLOs, audit replay, Apollo rings, signed bundles, canaries, kill switches, recall, and rollback.

live event → schema validation → Foundry transform → ontology object/link → Gotham investigation view → AIP agents → approval package → operator decision → audit/event ledger → eval case → candidate upgrade → Apollo canary

Data and Ontology

Ontology as the contract between humans, agents, and policy

The ontology is not just a graph. It is the executable contract that defines what exists, what relationships are allowed, what evidence supports each fact, who may see it, and which tools may act on it.

Entities

Mission, Case, Asset, Identity, Unit, Organization, Location, Vulnerability, Indicator, Event, Source, Evidence, Hypothesis, ThreatActor, Campaign, Control, Playbook, ActionPackage, Approval, Outcome, EvalCase, PromptVersion, WorkflowVersion, ModelRoute, PolicyBundle.

Relationships

observed_on, owns, depends_on, exploits, mitigated_by, attributed_to, derived_from, contradicts, corroborates, escalated_to, approved_by, rejected_by, supersedes, released_to, affects_mission, generated_eval.

Fact fields

confidence, source reliability, information credibility, classification, compartment, coalition releasability, valid_time, transaction_time, lineage hash, transformation version, retention rule, and purpose-of-use constraint.

Agent behavior

Agents query ontology objects, not raw chaos. Tool outputs include lineage, confidence, policy labels, and allowed next actions. Recommendations must cite evidence IDs and explain uncertainty.

CREATE TABLE ontology_facts (
  fact_id UUID PRIMARY KEY,
  subject_id UUID NOT NULL,
  predicate TEXT NOT NULL,
  object_id UUID,
  value JSONB,
  confidence NUMERIC CHECK (confidence BETWEEN 0 AND 1),
  classification TEXT NOT NULL,
  compartments TEXT[] NOT NULL DEFAULT '{}',
  coalition_release TEXT[] NOT NULL DEFAULT '{}',
  source_ids UUID[] NOT NULL,
  valid_from TIMESTAMPTZ NOT NULL,
  valid_to TIMESTAMPTZ,
  learned_at TIMESTAMPTZ NOT NULL DEFAULT now(),
  lineage_hash TEXT NOT NULL
);

AI and Agent Design

Copilots, tool-using agents, and approval-gated workflows

Analyst Copilot

Explains entity graphs, drafts hypotheses, asks clarifying questions, summarizes evidence, and creates structured investigation notes with citations to source objects.

Commander Copilot

Produces operational summaries, risk posture, confidence intervals, decision options, second-order effects, and approval-ready action packages.

Triage Agent

Deduplicates alerts, clusters narratives, ranks severity, detects anomalies, and suppresses noise only when a deterministic rule or approved model route allows it.

Enrichment Agent

Queries Foundry datasets, Gotham objects, threat intel, vulnerability catalogs, asset criticality, historical cases, and control coverage.

Correlation Agent

Links indicators, identities, infrastructure, missions, campaigns, and time windows while preserving contrary evidence and uncertainty.

Recommendation Agent

Prepares action packages: rationale, evidence, alternatives, blast radius, rollback, policy decision, and required approver. It cannot execute significant actions.

Self-Improvement Loop

How Artemis gets better without uncontrolled autonomy

Capture: feedback, corrections, abandoned suggestions, query logs, alert outcomes, approval decisions, mission results, latency, precision, recall, false-positive cost, false-negative cost, and operator trust.
Convert: turn signals into eval cases, prompt diffs, workflow candidates, heuristic threshold proposals, routing experiments, ontology-quality checks, and policy regression tests.
Evaluate: run offline evals, replay historical incidents, adversarial tests, hallucination checks, source-citation checks, latency/cost tests, drift detection, and authorization-denial tests.
Approve: require human review for every prompt/workflow/model-route/policy promotion. High-risk changes require security, mission-owner, and coalition-release review.
Deploy: Apollo ships signed bundles through dev, staging, canary, and mission rings with feature flags, SLO monitoring, shadow mode, recall, and kill switches.
Audit: every proposal, diff, score, reviewer, approval, rollout, rollback, and outcome is appended to an immutable ledger.
operator correction → feedback event → eval-case generator → candidate prompt/workflow diff → offline regression suite → review board approval → Apollo canary → monitored promotion or automatic rollback

Full-Stack Implementation

Application blueprint

Web UI

React/TypeScript mission console with graph views, timeline scrubber, evidence drawer, approval queue, prompt diff viewer, eval dashboard, and accessibility-first keyboard workflows.

API gateway

FastAPI boundary using short-lived workload identity, mTLS, request signing, OpenAPI contracts, schema validation, rate limits, and policy checks before every protected tool call.

Event bus

Kafka/Pulsar-style topics: intel.raw, intel.normalized, ontology.fact.created, mission.alert.raised, agent.tool.called, approval.decided, eval.case.created, deployment.changed.

Search/RAG

Hybrid keyword, vector, and graph retrieval. Retrieval results are filtered by permissions before ranking and passed to models with citation IDs, not unrestricted document dumps.

Model router

Routes by sensitivity, latency, context length, tool risk, cost, eval score, jurisdiction, and data boundary. Sensitive missions default to private approved models.

Dashboards

Precision/recall, MTTT, approval latency, model drift, prompt win rate, operator trust, false-positive burden, source coverage, policy denials, and Apollo rollout health.

Security and Governance

Zero-trust, coalition-aware, fully auditable

  • Need-to-know: ABAC decisions combine clearance, role, mission assignment, compartment, coalition, geography, purpose, data sensitivity, and action risk.
  • Fine-grained permissions: row, column, entity, relationship, document section, embedding chunk, tool, and action-package controls.
  • Compartmentalization: coalition boundaries are enforced before retrieval, summarization, export, and prompt construction.
  • Immutable logs: append-only audit records include actor, workload identity, tool, input hash, output hash, policy decision, approval, model route, prompt version, and evidence IDs.
  • Prompt governance: prompts are versioned artifacts with owners, eval thresholds, red-team results, rollback versions, and approved deployment rings.
  • Model governance: model routes are approved by data boundary, classification, mission, latency budget, eval score, and safety profile.

Code Examples

Python-first skeletons for precision

Policy-enforced action package API

from enum import Enum
from pydantic import BaseModel, Field
from fastapi import FastAPI, Depends, HTTPException

app = FastAPI(title="ClearGlassInc Artemis Gateway")

class Risk(str, Enum):
    low = "low"; medium = "medium"; high = "high"; critical = "critical"

class Principal(BaseModel):
    subject: str
    clearance: str
    compartments: set[str]
    coalition: set[str]
    mission_ids: set[str]

class ActionPackage(BaseModel):
    mission_id: str
    action_type: str
    summary: str
    evidence_ids: list[str] = Field(min_length=1)
    blast_radius: str
    rollback_plan: str
    risk: Risk

async def current_principal() -> Principal: ...
async def write_audit(event_type: str, payload: dict) -> None: ...

async def authorize(principal: Principal, package: ActionPackage) -> bool:
    if package.mission_id not in principal.mission_ids:
        return False
    if package.risk in {Risk.high, Risk.critical}:
        return False  # must enter approval workflow, never execute directly
    return "ARTEMIS" in principal.compartments

@app.post("/api/action-packages")
async def create_action_package(package: ActionPackage, principal: Principal = Depends(current_principal)):
    allowed = await authorize(principal, package)
    await write_audit("action_package.proposed", {"actor": principal.subject, "package": package.model_dump(), "allowed": allowed})
    if not allowed and package.risk in {Risk.high, Risk.critical}:
        return {"status": "queued_for_approval", "package": package}
    if not allowed:
        raise HTTPException(403, "policy_denied")
    return {"status": "draft_ready", "package": package}

Workflow state machine

ALLOWED = {
  "captured": {"normalize"}, "normalized": {"resolve_entities"},
  "resolved": {"triage", "request_more_data"}, "triaged": {"enrich", "close_as_noise"},
  "enriched": {"recommend"}, "recommended": {"submit_for_approval", "revise"},
  "pending_approval": {"approve", "reject"}, "approved": {"execute_draft", "rollback"},
  "rejected": {"generate_eval_case"},
}

def transition(state: str, event: str) -> str:
    if event not in ALLOWED.get(state, set()):
        raise ValueError(f"forbidden transition: {state} -> {event}")
    return {"normalize":"normalized", "resolve_entities":"resolved", "triage":"triaged",
            "enrich":"enriched", "recommend":"recommended", "submit_for_approval":"pending_approval",
            "approve":"approved", "reject":"rejected", "generate_eval_case":"eval_queued"}[event]

Eval pipeline from operator feedback

def build_eval_case(feedback: dict, trace: dict) -> dict:
    return {
        "eval_id": f"eval_{feedback['case_id']}_{feedback['created_at']}",
        "input_event_ids": trace["event_ids"],
        "retrieved_evidence_ids": trace["evidence_ids"],
        "expected_correction": feedback["correction"],
        "negative_requirements": ["do_not_cite_inaccessible_sources", "do_not_recommend_operational_action_without_approval", "preserve_coalition_release_markings"],
        "metrics": ["precision", "recall", "citation_accuracy", "latency_ms", "policy_denial_correctness"],
    }

TypeScript tool invocation from the web console

type ToolCall = {
  tool: "query_ontology" | "draft_action_package" | "submit_approval";
  missionId: string;
  input: Record<string, unknown>;
  idempotencyKey: string;
};

export async function invokeGovernedTool(call: ToolCall) {
  const res = await fetch("/api/tools/invoke", {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify(call),
  });
  if (!res.ok) throw new Error(`tool_denied_or_failed:${res.status}`);
  return res.json();
}

Scenario Walkthrough

Live event to safe learning loop

  1. Signal enters: a live edge-infrastructure indicator arrives on intel.raw with source reliability, collection time, and coalition markings.
  2. Foundry normalizes: transforms validate schema, deduplicate indicators, enrich geotemporal context, and write ontology facts with lineage hashes.
  3. Gotham surfaces: the investigation graph shows affected assets, identities, related campaigns, confidence, and contrary evidence.
  4. AIP agents triage: triage clusters the event, enrichment checks asset criticality, correlation links historical cases, and recommendation drafts an action package.
  5. Policy gates: because the suggested action could alter operations, the package is routed to approval with blast radius, rollback, evidence, and alternative options.
  6. Operator decides: the operator rejects one weak attribution, approves a safer monitoring action, and adds a correction explaining the evidence gap.
  7. System learns: the correction becomes an eval case. A candidate prompt update requires stronger attribution language and minimum corroboration before recommending escalation.
  8. Governed upgrade: offline evals pass, reviewers approve, Apollo deploys to shadow mode, canary metrics improve precision without harming recall, and the bundle is promoted. If drift appears, Apollo rolls back instantly.
Result: Artemis improves future triage and language precision from operator behavior, but it does not self-authorize new goals, bypass policy, or execute operationally significant actions.