Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungI wanted the diff, not a screenshot: a small URL-change API(24.09.2026 um 06:05 Uhr)
Sichere ProgrammierungFreeze Object Identity Before One Mutator Extract(24.09.2026 um 06:06 Uhr)
Sichere ProgrammierungRun an n8n workflow when a page's text changes(24.09.2026 um 06:12 Uhr)
Sichere ProgrammierungThe Spreadsheet That Runs Your Company (And Why That Should Worry You)(24.09.2026 um 06:12 Uhr)
Sichere ProgrammierungArchitecting an Enterprise Network on AWS Cloud WAN(24.09.2026 um 06:31 Uhr)
Sichere ProgrammierungI wanted the diff, not a screenshot: a small URL-change API(24.09.2026 um 06:05 Uhr)
Sichere ProgrammierungFreeze Object Identity Before One Mutator Extract(24.09.2026 um 06:06 Uhr)
Sichere ProgrammierungRun an n8n workflow when a page's text changes(24.09.2026 um 06:12 Uhr)
Sichere ProgrammierungThe Spreadsheet That Runs Your Company (And Why That Should Worry You)(24.09.2026 um 06:12 Uhr)
Sichere ProgrammierungArchitecting an Enterprise Network on AWS Cloud WAN(24.09.2026 um 06:31 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Building Darwin.js: A Self-Evolving Agentic Bazaar with FastAPI, Next.js, ChromaDB, and Live Code Mutation

Darwin.js started from a simple prompt: What if non-player characters could rewrite their own source code when players discovered exploits? That idea turns into a live simulation with four moving parts: a FastAPI backend that simulates…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Darwin.js started from a simple prompt:



What if non-player characters could rewrite their own source code when players discovered exploits?



That idea turns into a live simulation with four moving parts:




  • a FastAPI backend that simulates a bazaar

  • merchants that execute Python logic from local files

  • a Governor that monitors trade telemetry

  • a frontend that makes the entire adaptation loop visible



This post walks through how the system works, the tradeoffs behind the architecture, and how we made it demoable end-to-end.






The Product Idea



The app presents a cyber-bazaar where merchants sell items, take losses, and get attacked by a player using exploit presets like:




  • integer overflow

  • re-entrancy attack

  • item duplication



When the losses cross a threshold, the system mutates the merchant’s local trade(context) function and hot-reloads the new behavior.



This is important: the mutation is not hidden in logs. The app exposes the entire adaptive loop:




  • exploit trigger

  • telemetry logging

  • anomaly detection

  • code rewrite

  • post-mutation diff



That visibility is the difference between “AI magic” and a real systems demo.






System Architecture



System Architecture






1. Merchant logic is loaded from disk



Each merchant owns a file path that points at its current logic blob.



That matters because mutation becomes tangible. We are not just changing in-memory rules. We are actually rewriting the file that defines behavior.



Simplified shape:




@dataclass
class MerchantAgent:
id: str
display_name: str
gold: int
inventory: dict[str, int]
logic_blob_path: Path

def load_logic(self) -> str:
return self.logic_blob_path.read_text(encoding="utf-8")









2. Trade logic runs in a restricted sandbox



Instead of blindly executing arbitrary Python, the backend parses the AST and blocks dangerous constructs.




tree = ast.parse(code, mode="exec")
for node in ast.walk(tree):
if isinstance(node, (ast.With, ast.Try, ast.ClassDef, ast.Global, ast.Nonlocal)):
raise ValueError("Disallowed syntax")






We also strip __future__ imports before execution so merchants can keep ergonomic source files without tripping the restricted runtime.



That gives us a middle ground:




  • enough flexibility to demonstrate self-modifying logic

  • enough guardrails to avoid turning the demo into arbitrary code execution






3. MarketMemory stores telemetry



Every trade is converted into structured metadata:




{
"merchant_id": merchant_id,
"player_id": player_id,
"action": action,
"item": item,
"result": result,
"loss_to_npc": loss_to_npc,
"exploit_type": exploit_type or "none",
"timestamp": utc_now(),
}






ChromaDB is used when available, but the system is intentionally resilient:




  • it can fall back to in-memory collections

  • it uses deterministic embeddings for stability in constrained environments



That last choice matters. In a pure demo setting, the worst outcome is a backend that fails because a local ONNX embedding pipeline cannot initialize. We optimized for a stable runtime over fancy embeddings.






4. The Governor decides when to evolve



The Governor is the bridge between observability and adaptation.



It asks questions like:




  • How much gold has this merchant lost?

  • Is one item being abused repeatedly?

  • Is an exploit signature recurring?



Core logic:




trigger = merchant_loss > self.mutation_threshold or hottest_item_count > self.anomaly_limit






Once triggered, the Governor packages the latest telemetry and sends it to the evolution engine.






5. EvolutionService rewrites merchant code



In a production-grade system, this is where you would call a live model such as Codex or the Responses API. In Darwin.js, the interface is already shaped that way, but the implementation is deterministic so the demo remains runnable without network access.




new_code = self.mutator.generate_logic(
current_code=current_code,
exploit_telemetry=exploit_telemetry,
npc_state=npc_state,
)
logic_path.write_text(new_code, encoding="utf-8")






The generated code introduces defenses like:




  • price caps

  • duplication fingerprints

  • player blacklisting

  • cooldown locks



That means every mutation leaves a real artifact on disk and a visible diff in the UI.






Frontend Design



The key design goal was clarity under complexity.



We needed to show:




  • global system relationships

  • per-merchant state

  • exploit controls

  • mutation output



without turning the screen into mush.






Why React Flow was the right choice



The “God View” became the right abstraction because cards alone don’t explain causality.



A merchant card can show gold: 9800, but it cannot show:




  • the Governor supervising it

  • memory feeding anomaly signals back upstream

  • the player injecting exploits into a specific node



React Flow solves that cleanly.




<ReactFlow
nodes={nodes}
edges={edges}
nodeTypes={nodeTypes}
fitView
nodesDraggable={false}
nodesConnectable={false}
elementsSelectable={false}
>
<Background color="#0f2740" gap={24} />
<Controls showInteractive={false} />
</ReactFlow>






Once the system graph existed, the rest of the UI could stay focused:




  • merchant cards explain local state

  • terminal logs explain narrative sequence

  • the diff viewer explains mutation output






UI Architecture



UI Architecture






Example exploit flow



Let’s look at the “Integer Overflow” style demo path:




  1. The user selects a merchant in the UI.

  2. The frontend posts to /api/bazaar/exploit.

  3. The server translates that exploit into a payload like:




{
"merchant_id": "merchant-01",
"player_id": "judge-player",
"exploit_type": "integer_overflow"
}







  1. The merchant executes vulnerable sell logic.

  2. The trade produces outsized loss.

  3. The Governor sees the anomaly.

  4. The evolution engine writes a patched trade(context) function.

  5. The frontend refreshes, highlighting a new merchant revision and showing the code diff.






What was intentionally designed for demo stability



When building AI-heavy showcases, you have to decide what can fail and what absolutely cannot fail.



For Darwin.js, the core experience needed to survive offline and sandboxed environments.



That led to a few decisions:




  • local/system font stacks instead of remote font fetching

  • deterministic mutator instead of mandatory live API calls

  • ChromaDB with fallback-friendly behavior

  • test-client backend verification when port binding is restricted



This is a good pattern for developer demos in general:



Make the happy path real, but keep the runtime resilient enough that your demo doesn’t collapse when one dependency sneezes.






Code snippet: mutation-ready trade function



The generated merchant code intentionally returns structured risk flags:




if player["id"] in blacklist:
risk_flags.append("blocked:blacklist")
return {
"status": "blocked",
"reason": "known exploiter",
"risk_flags": risk_flags,
}






That becomes useful for both UI explanation and future analytics.






Where this can go next



Darwin.js already demonstrates self-evolving NPC behavior, but there are several obvious next steps:






Better AI mutation




  • wire in a live model call

  • add mutation evaluation and rollback

  • compare multiple candidate patches






Richer simulation




  • merchant-to-merchant supply chains

  • faction economies

  • adversarial autonomous player agents






Better platform architecture




  • WebSocket streaming

  • persistent event log storage

  • replayable mutations

  • deployment automation






Stronger developer ergonomics




  • test suite for generated merchant logic

  • snapshot-based mutation regression tests

  • Dockerized local environment






Why this project matters



Darwin.js is interesting because it treats AI adaptation as a software architecture problem, not a chatbot problem.



It asks:




  • How do agents observe failure?

  • How do they mutate safely?

  • How do humans inspect what changed?

  • How do we keep the system legible?



Those questions show up everywhere in the next wave of AI products:




  • autonomous operations systems

  • AI game agents

  • adaptive security tooling

  • self-healing workflows



This project is a small but concrete blueprint for building those systems visibly and responsibly.







Github Repo: https://github.com/harishkotra/darwin.js

SOC Incident Playbook: Remote Code Execution (RCE) Defense
title: Detect Exploitation - Building Darwin.js: A Self-Evolving Agentic Bazaar with FastAPI, Next.js, ChromaDB, and Live Code Mutation
id: 6fe691ea-d1ce-4612-9c2f-e186c820019b
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Building Darwin.js: A Self-Evo" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Building Darwin.js: A Self-Evolving Agen.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building Darwin.js: A Self-Evolving Agentic Bazaar with FastAPI, Next.js, ChromaDB, and Live Code Mutation

Thematisch verwandte Begriffe: Building, Darwinjs, SelfEvolving, Agentic · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96676 | A vulnerability was identified in Fast FAC1900R 20190827_2.0.2. The impa…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick