Skip to content

feat(agents): add typed validated agent configuration and safety interlocks (#107) - #194

Open
ryder777777 wants to merge 1 commit into
OracleDesk:developfrom
ryder777777:feat/issue-107-validated-agent-config
Open

ryder777777 wants to merge 1 commit into
OracleDesk:developfrom
ryder777777:feat/issue-107-validated-agent-config

Conversation

@ryder777777

@ryder777777 ryder777777 commented Oct 20, 2026 •

Copy link
Copy Markdown

What this does

Adds loadAgentConfig and redactConfig in agents/core/config.ts so agent entrypoints validate environment variables, contract addresses, and network parameters before constructing StellarAdapter.

  • Strict AGENT_MODE parsing ("dry-run" or "live", rejecting empty strings or unrecognised values with ConfigError).
  • Integer and basis-point validation (MIN_EDGE_BPS, CONFIDENCE_THRESHOLD_BPS, TRADE_SIZE_STROOPS, DEFAULT_SEED_STROOPS, SLIPPAGE_BPS, DEADLINE_SECS) so NaN cannot silently bypass strategy thresholds.
  • Secret-to-registered-agent public key verification in live mode, per-contract environment overrides (MARKET_CORE_CONTRACT_ID, TREASURY_CONTRACT_ID, etc.), and a two-step mainnet interlock (ALLOW_MAINNET + MAINNET_MAX_TRADE_STROOPS).
  • Secret redaction in redactConfig.
    Tested with cd oracledesk-stellar/agents && npm test && npm run build.

Closes #107

Checklist

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test pass
  • Soroban storage keys and checked integer arithmetic verified
  • No secrets or hardcoded keys included

How this was tested

Verified unit test cases covering nominal thresholds, boundary conditions, and deterministic state transitions.

@ryder777777
ryder777777 force-pushed the feat/issue-107-validated-agent-config branch from 3a8d0a8 to ebdf72a Compare October 21, 2026 12:38
@ryder777777
ryder777777 force-pushed the feat/issue-107-validated-agent-config branch from ebdf72a to b6d71f3 Compare October 23, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce a typed, validated agent configuration with network safety interlocks

1 participant