The initial iteration of our system implements a Reactive Agent Architecture. In this model, the focus is on rapid detection and immediate, hard-coded mitigation of threats. The system consists of three specialized Java agents: LocalAgent, CentralAgent, and MobileAgent.
The LocalAgent is deployed on every client node. Its primary responsibility is continuous resource monitoring without inducing significant overhead on the host.
Methodology: We implemented a TickerBehaviour that cycles every 5 seconds.
The Monitoring Cycle:
addBehaviour(new TickerBehaviour(this, 5000) {
@Override
protected void onTick() {
double cpuLoad = getRealCpuLoad();
double netLoad = getNetworkKBs();
// Encapsulate metrics in an ACL Message
sendMetrics(cpuLoad, netLoad);
// Local console feedback for debugging
System.out.printf("CLIENT: [Sent] CPU: %.2f%% | NET: %.2f KB/s%n", cpuLoad, netLoad);
}
});

Figure 5.1: local agent reporting CPU and network stats.
The CentralAgent acts as the orchestrator. It listens for ACLMessage.INFORM messages from all local agents.
Detection Logic: The agent compares telemetry against static thresholds (e.g., CPU > 80%). On violation, it deploys a MobileAgent.
The Threshold Logic:
if (cpuUsage > CPU_THRESHOLD) {
System.out.println("ALERT: Anomaly detected on " + senderAgentName);
deployMobileAgent(senderAgentName, "stress"); // Hardcoded target for V1
}
This is the most critical component of our distributed system. Instead of sending a command string to be executed by the local agent (RPC style), we migrate the entire MobileAgent code to the infected node.
Mechanism:
Migration Logic:
@Override
protected void setup() {
// ... args parsing ...
ContainerID destination = new ContainerID(destinationContainer, null);
System.out.println("Mobilizing to " + destinationContainer);
doMove(destination);
}
@Override
protected void afterMove() {
// Logic executed ONLY after arriving at the destination
Runtime.getRuntime().exec("pkill -9 " + processToKill);
doDelete();
}
Advantages:
Limitations:
To address these limitations, specifically the lack of context in decision-making, we introduced an evolved “Audit & Whitelist” approach in the next section.