Borjan Ladinski

Back to Articles

Building Safer AI Agents: 250 Actions Tested with Deterministic Validation

AI agents can plan, reason, and make decisions. But what happens when those decisions directly change a shared environment?

In our research, we developed MACSWC (Multi-Agent Conflict Simulation With World Constraints), a framework designed to separate AI reasoning from authoritative execution.

Rather than allowing large language models (LLMs) to modify the simulation directly, every generated action is treated as a proposal that must pass validation before execution.

We evaluated the framework through 50 simulation rounds and 250 proposed actions.

The results were:

  • 201 actions accepted
  • 31 actions rejected by the Secretary Agent
  • 18 actions rejected by the Board Agent
  • 0 actions rejected by the World Engine

The central idea is simple: AI agents can propose actions, but deterministic software controls what actually happens.

Why We Conducted This Research

Large language models have made it possible to build multi-agent systems where several AI agents cooperate, compete, negotiate, and make strategic decisions.

Frameworks such as CAMEL, AutoGen, MetaGPT, and Generative Agents have demonstrated how role-based agents can interact and solve problems.

However, LLMs are probabilistic systems.

They can generate malformed outputs, refer to nonexistent entities, propose unsupported actions, or produce decisions that conflict with established rules.

These problems become particularly serious when an agent is allowed to change a persistent environment.

For example, imagine an AI agent controlling a simulated country.

It might attempt to form an alliance with a country that does not exist, declare war against an invalid target, or create a diplomatic agreement that conflicts with the current world state.

If such actions are executed without validation, the simulation can become inconsistent.

Our research addresses this problem through a layered architecture that separates AI-generated proposals from authoritative state changes.

What Is MACSWC?

MACSWC stands for Multi-Agent Conflict Simulation With World Constraints.

It is a deterministic multi-agent framework for geopolitical simulation.

The simulation is inspired by the Second Balkan War of 1913 and includes five countries:

  • Bulgaria
  • Serbia
  • Greece
  • Romania
  • The Ottoman Empire

Each country is represented by an AI agent capable of proposing diplomatic, military, and economic actions.

Supported actions include alliance formation, declarations of war, peace negotiations, sanctions, trade agreements, and diplomatic communication.

However, the agents cannot directly modify the simulated world.

Every proposed action must pass through a controlled decision pipeline.

The historical scenario provides the test environment, but the main research contribution is the validation architecture rather than historical reconstruction.

The MACSWC Architecture

The framework uses four primary components.

1. Country Agents: Strategic Reasoning

Country Agents represent the participating countries.

Each agent receives structured information about the current environment, including:

  • Diplomatic relationships
  • Military conditions
  • Existing alliances
  • Economic information
  • Recent events
  • Available actions

Based on this information, the agent generates a strategic proposal.

For example, a country agent might propose forming an alliance or negotiating peace.

Importantly, the proposal does not immediately change the simulation.

It is passed to the next component for validation.

2. Secretary Agent: Structural Validation

The Secretary Agent checks whether a proposed action is structurally and logically valid.

Its responsibilities include verifying:

  • JSON structure
  • Required parameters
  • Supported action types
  • Valid target countries
  • Compliance with registered action rules

If the proposal is malformed or refers to an invalid entity, it is rejected.

This prevents common LLM errors from reaching the execution layer.

In the reported experiment, the Secretary Agent rejected 31 proposals.

3. Board Agent: Strategic Evaluation

A proposal that passes structural validation moves to the Board Agent.

The Board Agent evaluates its strategic value and potential risk.

Factors include diplomatic relationships, military conflicts, alliance structures, and geopolitical crisis risk.

The framework uses a simplified utility model to evaluate whether an action's expected benefit exceeds its potential strategic cost.

Proposals below the approval threshold are rejected before reaching the World Engine.

In our experiment, the Board Agent rejected 18 proposals.

4. World Engine: Authoritative Execution

The World Engine maintains the authoritative simulation state.

It manages information such as:

  • Countries and their status
  • Alliances
  • Diplomatic relationships
  • Military conflicts
  • Sanctions
  • Treaties
  • Historical events

Only the World Engine can modify the world state.

Before applying an approved action, it performs a final consistency check.

This design prevents an LLM from directly introducing invalid state changes.

In the reported experiment, the World Engine recorded zero rejections after the earlier validation stages.

This does not mean the World Engine was unnecessary. It remained the final authority responsible for consistent execution.

How the Decision Pipeline Works

Each simulation round follows the same controlled workflow.

Step 1: World observation

The World Engine provides structured information about the current simulation state.

Step 2: Action proposal

A Country Agent uses an LLM to generate a proposed strategic action.

Step 3: Structural validation

The Secretary Agent checks whether the proposed action is valid and supported.

Step 4: Strategic evaluation

The Board Agent evaluates the action's potential benefit and risk.

Step 5: Authoritative execution

The World Engine performs a final consistency check and executes the approved action.

Step 6: State update

The resulting world state becomes the starting point for the next simulation round.

The pipeline uses sequential execution to avoid conflicting state updates.

This separation is what makes the architecture different from systems that allow agents to execute their own generated actions directly.

Implementation and Experimental Setup

We implemented MACSWC using Python 3.

The system uses:

  • Python: Core implementation
  • NetworkX: Diplomatic relationship graphs
  • JSON: Persistent world-state information
  • LLM provider interfaces: Model-independent agent reasoning
  • Deterministic validation: Structural and execution constraints

The framework supports multiple LLM providers through a unified interface, including OpenAI, Groq, Hugging Face, and locally deployed Ollama models.

The architecture allows different reasoning models to operate through the same validation pipeline.

The evaluation scenario included five autonomous country agents interacting across multiple simulation rounds.

We focused on architectural reliability, rather than predicting historically accurate outcomes.

The evaluation tracked accepted proposals, rejected proposals, diplomatic changes, alliance formation, conflicts, crisis risk, and simulation stability.

Experimental Results

Our paper reports the following results:

Metric Result
Simulation rounds 50
Actions generated 250
Actions accepted 201
Secretary Agent rejections 31
Board Agent rejections 18
World Engine rejections 0

Finding 1: 49 Invalid or Rejected Actions Were Stopped Before Execution

Out of 250 generated actions, 49 did not pass the validation pipeline.

The Secretary Agent rejected 31 proposals because of structural or rule-related problems.

The Board Agent rejected another 18 proposals during strategic evaluation.

This means that 19.6% of generated proposals were rejected before execution.

Without validation, these proposals could have affected the simulated environment.

The result illustrates the value of treating AI-generated actions as untrusted proposals rather than executable commands.

Finding 2: The World Engine Maintained a Consistent State

The paper reports that the World Engine maintained a consistent simulation throughout the experimental rounds.

Approved actions passed the required validation stages before execution.

The framework prevented contradictory relationships, duplicate alliances, and impossible military operations within the tested scenario.

This was possible because all state changes were controlled by one authoritative component.

Finding 3: Validation and Reasoning Were Kept Separate

A central finding was that reliable state management does not have to depend entirely on how well the LLM reasons.

The language model generates strategic proposals.

The validation pipeline checks their structure and strategic acceptability.

The World Engine controls state changes.

This approach allows the reasoning model to remain flexible without giving it unrestricted execution authority.

Why This Matters Beyond Geopolitical Simulations

Although MACSWC was evaluated in a geopolitical simulation, the architectural principle is relevant to other systems involving AI agents.

Consider an AI agent that interacts with business software.

It might propose updating a record, changing a workflow state, or taking an action that affects other users.

A reliable implementation should not assume that every model-generated instruction is valid.

Instead, the system can separate:

  1. Reasoning: The LLM decides what it wants to do.
  2. Validation: Deterministic checks verify that the proposed action is allowed.
  3. Execution: Trusted application code performs the state change.

This approach can be useful when designing AI automation, financial workflows, and other applications where incorrect actions may have serious consequences.

These are potential applications of the design principle, not environments directly evaluated by the MACSWC experiment.

Research Limitations

Our research focused on the reliability of a particular multi-agent simulation architecture.

Several limitations are important:

  • The evaluation used one geopolitical scenario with five countries.
  • Results are based on 50 simulation rounds and 250 proposed actions.
  • The experiment did not establish universal safety guarantees for arbitrary LLM agents.
  • The paper did not provide a controlled comparison of failure rates across multiple competing frameworks.
  • The results do not demonstrate safety in real financial, military, or production business systems.

Further research could evaluate larger simulations, different scenarios, adaptive strategic evaluation, and human-in-the-loop decision support.

Conclusion

MACSWC demonstrates an approach to building multi-agent AI systems where language models perform reasoning but do not directly control the environment.

Across 50 simulation rounds, the framework evaluated 250 generated actions.

201 actions were accepted, while 49 were rejected before execution.

The reported simulation maintained a consistent world state through a layered architecture consisting of Country Agents, a Secretary Agent, a Board Agent, and a centralized World Engine.

The most important takeaway is:

AI agents should propose actions. Trusted software should decide whether those actions are allowed and how they are executed.

This separation provides a useful design principle for building more reliable autonomous systems.

Original Research Paper

Title: MACSWC – Multi-Agent Conflict Simulation With World Constraints

Authors: - Borjan Ladinski - Dusko Sofronievski - Marija Stankova Medarovska

Affiliation: University American College Skopje, School of Computer Science and Information Technology.

Conference manuscript: International Conference on Computer Sciences (IHCONCS 2026), Zagreb, Croatia, September 17–18, 2026.

This article is an accessible technical summary of our co-authored research. The findings and numerical results are based on the original manuscript.

About the Author

I'm Borjan Ladinski, an AI Engineer Expert and AI Consultant based in Skopje, North Macedonia.

I build AI agents, LLM applications, RAG systems, machine learning solutions, and Python backend systems.

Explore my work and AI consulting services at borjan.ladinski.com.