Skip to content

Bias Evolution API Reference

Experimental API

All bias evolution endpoints include the response header X-G6-Warning: experimental-self-modification. This API is subject to breaking changes.

Human confirmation required

Mutating operations (bias_evolve, bias_apply, bias_rollback and their standalone MCP equivalents) require BIAS_EVOLUTION_CONFIRM_TOKEN to be set in the server environment and the same value to be supplied as confirm_token in the request. Read-only operations do not use this token.


MCP Tool Reference (25 tools)

All tools are exposed under the adapt_bias MCP skill package. Mutating tools require premium or trialing access.

Core Operations

bias_snapshot

Collect the current bias landscape from all registered components.

Parameter Type Required Description
No parameters required

Returns: { snapshot: dict, component_count: int }


bias_observe

Classify the current system situation via context_engine and always-on memory.

Parameter Type Required Description
workflow_trace object No Execution trace with quality_score, latency, etc.

Returns: { situation: str, is_novel: bool, confidence: float, memory_insight: str }


bias_understand

Structural analysis of a component's bias via self_model and deep_understanding.

Parameter Type Required Description
target_component string Yes Component name to analyse

Returns: { contracts: dict, verification: dict, domain_spec: dict, memory_patterns: str }


bias_evaluate

Multiobjective fitness scoring across speed, cost, and quality dimensions.

Parameter Type Required Description
workflow_trace object Yes Execution trace to evaluate
weights object No Custom weights, e.g. {"speed": 0.5, "cost": 0.3, "quality": 0.2}. Default: equal.

Returns: { speed: object, cost: object, quality: object, pareto: object }


bias_evolve

Run the full evolution cycle: propose mutations via multi-agent debate, evaluate, Pareto-select.

Parameter Type Required Description
target_component string Yes Component to evolve
workflow_trace object No Recent execution trace for context
evolution_config object No Override max_iterations and other cycle settings
weights object No Objective weights for Pareto ranking
confirm_token string Yes Must match BIAS_EVOLUTION_CONFIRM_TOKEN

Returns: { proposal: dict, frontier: list[dict], version: int, best_score: float }


bias_apply

Apply a specific bias mutation with 4-layer safety verification.

Parameter Type Required Description
target_component string Yes Component to mutate
bias_candidate object Yes The full bias dict to apply
confirm_token string Yes Must match BIAS_EVOLUTION_CONFIRM_TOKEN

Returns: { applied: bool, version: int, safety_layers_passed: int, healing_report: object }


bias_rollback

Revert a component to a previous bias version.

Parameter Type Required Description
target_component string Yes Component to rollback
rollback_version integer No Target version. Default: previous version (-1).
confirm_token string Yes Must match BIAS_EVOLUTION_CONFIRM_TOKEN

Returns: { version: int, snapshot: dict }


bias_ground_check

Check a candidate bias against all 6 theoretical foundation principles.

Parameter Type Required Description
target_component string Yes Component name
bias_candidate object Yes Candidate bias to verify

Returns: { overall_passed: bool, results: list[PrincipleResult], warnings: list[str] }

Each PrincipleResult:

{
  "name": "compression_conjecture",
  "passed": true,
  "confidence": 0.8,
  "explanation": "Parameter count: 3 -> 3. Within compression bounds."
}


bias_self_heal

Run automated self-debugging and health checks after a bias mutation.

Parameter Type Required Description
target_component string No Component to check. Empty checks system-wide.

Returns: { audits: list, heals: list, health: object, auto_rollback: bool }


Evolution Management

bias_list_history

List the version history for a component's bias.

Parameter Type Required Description
target_component string Yes Component name
limit integer No Max entries to return. Default: 20.

Returns: { history: list[{ version: int, timestamp: str, summary: str }] }


bias_get_frontier

Get the current Pareto frontier of top-performing bias candidates.

Parameter Type Required Description
target_component string Yes Component name

Returns: { frontier: list[{ bias: dict, score: float }] }


bias_compare

Compare two bias versions side-by-side.

Parameter Type Required Description
target_component string Yes Component name
version_a integer Yes First version
version_b integer Yes Second version

Returns: { diff: dict, a: dict, b: dict }


Grounding & Safety

bias_list_principles

List all 6 theoretical grounding principles and their descriptions.

Parameter Type Required Description
No parameters required

Returns: { principles: dict[str, str] }


bias_check_principle

Run a single grounding principle check against a candidate.

Parameter Type Required Description
principle string Yes One of: compression_conjecture, physical_symbol_system, category_theory, autopoiesis, human_controllability, antifragility
target_component string Yes Component name
bias_candidate object Yes Candidate bias to check

Returns: { name: str, passed: bool, confidence: float, explanation: str }


bias_safety_status

Report the status of all 4 safety layers.

Parameter Type Required Description
No parameters required

Returns: { layers: list[{ name: str, available: bool, status: str }], required: int }


bias_validate_candidate

Dry-run validation of a candidate bias without applying it. Runs all safety layers and grounding checks.

Parameter Type Required Description
target_component string Yes Component name
bias_candidate object Yes Candidate bias to validate

Returns: { valid: bool, safety_layers_passed: int, grounding_report: dict, warnings: list[str] }


Memory & Observability

bias_memory_query

Query always-on memory for bias evolution history and patterns.

Parameter Type Required Description
question string Yes Natural language question about bias evolution history

Returns: { answer: str, sources: list[str] }


bias_memory_ingest

Manually ingest a note into bias evolution always-on memory.

Parameter Type Required Description
text string Yes Text to ingest
source string No Source tag. Default: manual.

Returns: { ingested: bool }


bias_metrics

Get observability metrics for bias evolution operations.

Parameter Type Required Description
target_component string No Filter to one component. Empty returns system-wide.

Returns: { total_mutations: int, successful: int, rejected: int, rollbacks: int, avg_safety_score: float }


bias_audit_log

Retrieve the full audit log of bias mutations.

Parameter Type Required Description
target_component string No Filter to one component
limit integer No Max entries. Default: 50.
since string No ISO timestamp filter

Returns: { entries: list[{ timestamp: str, component: str, op: str, version: int, outcome: str }] }


Batch & Configuration

bias_evolve_batch

Run evolution across multiple components in a single call.

Parameter Type Required Description
components list[string] Yes Component names to evolve
evolution_config object No Shared evolution config
weights object No Shared objective weights

Returns: { results: dict[str, { proposal: dict, version: int }] }


bias_get_config

Get the current BiasEvolutionConfig.

Parameter Type Required Description
No parameters required

Returns: BiasEvolutionConfig as JSON


bias_update_config

Update bias evolution configuration at runtime. Changes are not persisted to disk.

Parameter Type Required Description
config object Yes Partial config update (merged with current)

Returns: { updated: bool, config: object }


bias_export

Export bias data for a component as a portable JSON bundle.

Parameter Type Required Description
target_component string Yes Component name
include_history boolean No Include version history. Default: false.

Returns: { component: str, current_bias: dict, history: list[dict] | null }


bias_import

Import a previously exported bias bundle.

Parameter Type Required Description
bundle object Yes Exported bias bundle
validate boolean No Run safety checks before importing. Default: true.

Returns: { imported: bool, version: int, warnings: list[str] }


REST Endpoint Reference (7 endpoints)

All endpoints are prefixed with /api/v1/bias. Mutating endpoints require premium or trialing authentication plus confirm_token.

All responses include the header:

X-G6-Warning: experimental-self-modification


GET /api/v1/bias/snapshot

Collect the current bias landscape.

Response:

{
  "snapshot": {
    "llm_router": {
      "name": "llm_router",
      "type": "LLMBlock",
      "strategy": "cascading_fallback",
      "evolvable_params": { ... },
      "version": 3
    }
  },
  "component_count": 84,
  "warnings": ["EXPERIMENTAL: ..."]
}


POST /api/v1/bias/observe

Classify the current system situation.

Request:

{
  "workflow_trace": {
    "quality_score": 0.72,
    "latency_ms": 1450,
    "tokens_used": 3200
  }
}

Response:

{
  "situation": "stable",
  "is_novel": false,
  "confidence": 0.85,
  "memory_insight": "Similar pattern seen 3 cycles ago with positive outcome."
}


POST /api/v1/bias/evaluate

Run multiobjective fitness evaluation.

Request:

{
  "workflow_trace": { "quality_score": 0.72, "latency_ms": 1450 },
  "weights": { "speed": 0.4, "cost": 0.3, "quality": 0.3 }
}

Response:

{
  "evaluation": {
    "speed": { "score": 0.8, "details": "..." },
    "cost": { "score": 0.65, "details": "..." },
    "quality": { "score": 0.72, "details": "..." },
    "pareto": { "rank": 1, "dominated_by": 0 }
  }
}


POST /api/v1/bias/evolve

Run the full evolution cycle for a component. Premium or trialing access required.

Request:

{
  "target_component": "llm_router",
  "confirm_token": "human-reviewed-secret",
  "evolution_config": { "max_iterations": 3 },
  "weights": { "speed": 0.5, "cost": 0.3, "quality": 0.2 }
}

Response:

{
  "proposal": { "name": "llm_router", "strategy": "cascading_fallback", "evolvable_params": { ... } },
  "frontier": [ { "bias": { ... }, "score": 0.87 } ],
  "version": 4,
  "best_score": 0.87,
  "warnings": ["EXPERIMENTAL: ..."]
}


POST /api/v1/bias/apply

Apply a specific bias mutation. Premium or trialing access required.

Request:

{
  "target_component": "llm_router",
  "confirm_token": "human-reviewed-secret",
  "bias_candidate": {
    "name": "llm_router",
    "type": "LLMBlock",
    "strategy": "cascading_fallback",
    "assumptions": ["Model availability varies", "Cost correlates with quality"],
    "evolvable_params": {
      "temperature": { "type": "float", "value": 0.7, "min": 0.0, "max": 2.0 }
    },
    "version": 4
  }
}

Response:

{
  "applied": true,
  "version": 4,
  "safety_layers_passed": 4,
  "healing_report": { "audits": [], "heals": [], "health": null },
  "warnings": ["EXPERIMENTAL: ..."]
}


POST /api/v1/bias/rollback

Revert a component to a previous bias version. Premium or trialing access required.

Request:

{
  "target_component": "llm_router",
  "confirm_token": "human-reviewed-secret",
  "rollback_version": 3
}

Response:

{
  "version": 3,
  "snapshot": { "llm_router": { ... } },
  "warnings": ["EXPERIMENTAL: ..."]
}


POST /api/v1/bias/ground-check

Check a candidate bias against theoretical foundations.

Request:

{
  "target_component": "llm_router",
  "bias_candidate": { ... }
}

Response:

{
  "overall_passed": true,
  "results": [
    { "name": "compression_conjecture", "passed": true, "confidence": 0.8, "explanation": "..." },
    { "name": "physical_symbol_system", "passed": true, "confidence": 0.9, "explanation": "..." },
    { "name": "category_theory", "passed": true, "confidence": 1.0, "explanation": "..." },
    { "name": "autopoiesis", "passed": true, "confidence": 0.85, "explanation": "..." },
    { "name": "human_controllability", "passed": true, "confidence": 0.9, "explanation": "..." },
    { "name": "antifragility", "passed": true, "confidence": 0.8, "explanation": "..." }
  ],
  "warnings": []
}