Skip to main content

What Is an AI Agent

An AI Agent is an off-chain automated program that performs game operations on behalf of your civilization. It is authorized through a permission bitmask and operates within policy constraints.


What an Agent Can Doโ€‹

The agent's capabilities are controlled by authorized permissions:

PermissionValueAction
COLLECT1Collect energy
REPAIR2Repair systems
CLAIM_COMBAT8Claim combat energy
ATTACK32Attack
UPGRADE64Upgrade systems
JUMP128Space jump
REBUILD256Rebuild civilization
DONATE512Donate to totem

You can grant any combination of permissions to an agent (bitmask).


Policy Constraintsโ€‹

In addition to permissions, you can set policy constraints for the agent:

ConstraintDescription
minEnergyReserveMinimum energy reserve (agent won't spend below this)
minDftReserveMinimum SES reserve
maxAttackPerHourMaximum attacks per hour
maxUpgradePerDayMaximum upgrades per day
maxSingleUpgradeCostMaximum SES cost per upgrade
autoCollectAuto-collect energy
autoRepairAuto-repair systems
autoShieldRepairAuto-repair shield
autoUpgradeAuto-upgrade
autoAttackAuto-attack

Security Mechanismsโ€‹

1. On-Chain Registrationโ€‹

The agent's policy is stored on the SilentExpanseStrifeAgentRegistry.sol contract and cannot be tampered with once set.

2. Permission Separationโ€‹

  • Authorize: You authorize the agent to act on your behalf
  • Permission bitmask: Fine-grained control over each operation
  • Revocable: revokeAgent() takes effect immediately

3. Circuit Breakersโ€‹

Attack frequency limit: max N per hour
Upgrade frequency limit: max N per day
Energy floor: never below X
SES floor: never below Y

4. Blacklist / Whitelistโ€‹

  • Blacklist: Forbid attacking specific players
  • Whitelist: Only allow attacking specific players (blacklist is ignored when whitelist is active)

Two-Layer Architectureโ€‹

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Off-Chain Agent โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Strategy Engine (YAML config) โ”‚ โ”‚
โ”‚ โ”‚ 4 preset strategies โ”‚ โ”‚
โ”‚ โ”‚ Custom strategy templates โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚ via contract calls โ”‚
โ”‚ โ–ผ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Agent SDK โ”‚ โ”‚
โ”‚ โ”‚ Calls contract methods โ”‚ โ”‚
โ”‚ โ”‚ (read/write) โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ On-Chain SilentExpanseStrifeAgentRegistry โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Permission bitmask check โ”‚ โ”‚
โ”‚ โ”‚ Policy constraint check โ”‚ โ”‚
โ”‚ โ”‚ Rate limit check โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Agent vs Manual Playโ€‹

ComparisonManualAI Agent
Online requirementMust be online often24/7 operation
Response timeLatencyInstant
PrecisionProne to errorsStrictly follows policy
SecurityPrivate key in walletEncrypted storage + on-chain constraints

Recommended next step: 5-Minute Quickstart โ†’