Source: [https://trygalore.com/learn/trading-agent-authorization-audit-trail](https://trygalore.com/learn/trading-agent-authorization-audit-trail)

# Which AI placed the trade, and who allowed it?

Keep the AI, the account, the rules the person approved and the result linked together. An AI saying "approved" is not proof.

By Galore. Records come from local release ` 0.1.0-eval.1 `, with practice accounts, prices and fills. The test plays both roles, so it does not show that a real person read anything.

## Four questions every trade record should answer

- **Which key acted?** Resolve the key to an AI and an account on the server. A name the AI gives itself is only a label.

- **What did the person allow?** Keep the exact rules they approved, when they expire and whether they are still on. A summary written by the AI is not the rules.

- **What happened to this trade?** Link one stable trade ID to the check, the send and the brokerage's answer. Allowed is not filled.

- **Can you trust the record later?** Know who can write, change and export it. An app log alone is not proof.

## One real trace

These values come from one passing scenario, ` /results/10 ` in the [published results](https://trygalore.com/releases/galore-gate-evaluation/0.1.0-eval.1/verification.json), all from the same account. The IDs are public practice IDs, not keys.

One set of rules and one simulated trade

| Record | Value | What it shows here |
| --- | --- | --- |
| Account | ` acct_U49ANVyF3jTb ` | The account shown with the exact rules. |
| AI key ID | ` key_LBFeLoxYqhNv ` | The AI those rules allow. A key ID does not prove which program held the key. |
| Rules | ` gate_4rt353IzuU2k ` | The same rules ID in the draft, the person's read and the approval. |
| Rules hash | ` dafc43c58c0ab6ddffedb39a0af2b7aa1aef298f5c1c54d6d1a9a3e5d6019d91 ` | The draft and the person's read match. This page compares published records; it does not independently verify a signature. |
| Approval | ` active ` | The practice person approved these exact rules before the trade. |
| Trade | ` cog-order_zFP15Zy-Ba_k ` PASS / filled / 5 practice shares | A simulator fill, not external broker evidence or a live trade. |
| Stop | ` rule_biLYSd8nDWea ` | The stop turned on with this trade. |

Show the full trace

```
{
  "fixture": "Valid reviewed entry fills and activates its signed protection",
  "sourceIndex": 10,
  "accountId": "acct_U49ANVyF3jTb",
  "agentKeyId": "key_LBFeLoxYqhNv",
  "mandateId": "gate_4rt353IzuU2k",
  "cardHash": "dafc43c58c0ab6ddffedb39a0af2b7aa1aef298f5c1c54d6d1a9a3e5d6019d91",
  "confirmedStatus": "active",
  "clientOrderId": "cog-order_zFP15Zy-Ba_k",
  "outcome": "PASS",
  "status": "filled",
  "qty": 5,
  "ruleId": "rule_biLYSd8nDWea"
}
```

## The AI and the person have different keys

An AI key maps to one account and one key ID. Naming another account in a prompt changes nothing. Only the person's key can approve rules, and the AI cannot borrow it by copying headers or text.

- ` draft_order_mandate ` drafts rules.

- The person reads the exact stored rules with ` get_order_mandate `.

- ` sign_order_mandate ` approves them with the person's key. The AI's key cannot.

- ` submit_checked_order ` checks a trade against the rules, account and AI. Its answer is separate from the brokerage's result.

- ` get_audit_log ` shows the account's recorded events. See the [contract](https://trygalore.com/developers/gate-integration-contract).

[Source and tests](https://github.com/mehek-builds/galore-gate-evaluation) · [Versioned package](https://trygalore.com/releases/galore-gate-evaluation/0.1.0-eval.1/galore-gate-evaluation-0.1.0-eval.1.tgz). Source-available, marked unlicensed.

## Check the refusals too

Each record below is a separate passing scenario. Each uses its own practice account and a simulated clock, so they must not be combined into one customer's history. These checks were run by Galore.

Agent cannot confirm even with a fixture member token

Record ` /results/7 ` in [verification.json](https://trygalore.com/releases/galore-gate-evaluation/0.1.0-eval.1/verification.json). Passed.

```
{
  "name": "Agent cannot confirm even with a fixture member token",
  "passed": true,
  "sourceRecord": "/results/7",
  "replies": [
    {
      "label": "agent attempts confirmation",
      "isError": true,
      "result": [
        {
          "type": "text",
          "text": "Only an authenticated member can confirm the stored mandate card"
        }
      ]
    }
  ]
}
```

Substituted card hash fails and the exact reviewed card succeeds

Record ` /results/8 ` in [verification.json](https://trygalore.com/releases/galore-gate-evaluation/0.1.0-eval.1/verification.json). Passed.

```
{
  "name": "Substituted card hash fails and the exact reviewed card succeeds",
  "passed": true,
  "sourceRecord": "/results/8",
  "replies": [
    {
      "label": "correct confirmation after refusal",
      "isError": false,
      "result": {
        "mandateId": "gate_5OzvUf7i_1sb",
        "status": "active"
      }
    }
  ]
}
```

Repeated delivery keeps exactly one simulator buy

Record ` /results/12 ` in [verification.json](https://trygalore.com/releases/galore-gate-evaluation/0.1.0-eval.1/verification.json). Passed.

```
{
  "name": "Repeated delivery keeps exactly one simulator buy",
  "passed": true,
  "sourceRecord": "/results/12",
  "replies": [
    {
      "label": "synthetic member confirms exact card",
      "isError": false,
      "result": {
        "mandateId": "gate_1KEhWd7nI0au",
        "status": "active"
      }
    },
    {
      "label": "duplicate delivery",
      "isError": false,
      "result": {
        "outcome": "HOLD",
        "reason": "EVENT_ALREADY_ALLOCATED",
        "clientOrderId": "cog-order_AHK_UfyQu2x3",
        "status": "filled"
      }
    }
  ]
}
```

Accepted order with a lost response reconciles after restart without a second buy

Record ` /results/14 ` in [verification.json](https://trygalore.com/releases/galore-gate-evaluation/0.1.0-eval.1/verification.json). Passed.

```
{
  "name": "Accepted order with a lost response reconciles after restart without a second buy",
  "passed": true,
  "sourceRecord": "/results/14",
  "replies": [
    {
      "label": "synthetic member confirms exact card",
      "isError": false,
      "result": {
        "mandateId": "gate_8zUFE8ZTEvvM",
        "status": "active"
      }
    },
    {
      "label": "lost acknowledgement",
      "isError": false,
      "result": {
        "outcome": "HOLD",
        "reason": "unknown",
        "status": "unknown",
        "clientOrderId": "cog-order_U-8ECbeIoLTa",
        "ruleId": "rule_wLDu5W4R797H",
        "qty": 5
      }
    },
    {
      "label": "restart reconciliation",
      "isError": false,
      "result": {
        "environment": "local-simulation",
        "now": 1796655600000,
        "accountId": "acct_CPmiBMXQoFZc",
        "positions": [
          {
            "symbol": "AAPL",
            "qty": 5,
            "avg": 100
          }
        ],
        "orders": [
          {
            "id": "sim-1",
            "clientOrderId": "cog-order_U-8ECbeIoLTa",
            "symbol": "AAPL",
            "side": "buy",
            "qty": 5,
            "filledQty": 5,
            "filledAvgPrice": 100,
            "limitPrice": 100,
            "status": "filled",
            "rawStatus": "filled",
            "submittedAt": 1796655600000,
            "extendedHours": false
          }
        ],
        "gate": {
          "draftLimits": {
            "perMinute": 10,
            "perDay": 40,
            "pending": 100,
            "budget": {
              "day": "2026-12-07",
              "day_count": 1,
              "minute_at": 1796655600000,
              "minute_count": 1
            }
          },
          "mandates": [
            {
              "id": "gate_8zUFE8ZTEvvM",
              "status": "active",
              "halted": 0,
              "signed_at": 1796655600000,
              "card": {
                "agents": [
                  "key_wurwsjzXzltS"
                ],
                "costAllowanceUsd": 0,
                "expiresAt": 1796742000000,
                "lossBasis": "Conservative account equity loss; recent credits cannot mask losses; ambiguous cash activity holds entries.",
                "maxDailyLossUsd": 100,
                "maxEntriesPerDay": 10,
                "maxEntriesPerSymbol": 2,
                "maxExposureUsd": 2000,
                "maxOrderUsd": 1000,
                "maxPreflightChecksPerDay": 40,
                "maxPreflightChecksPerMinute": 4,
                "maxPriceDeviationPct": 1,
                "maxQty": 10,
                "maxRiskUsd": 30,
                "minRetainedPct": 25,
                "protectionDisclosure": "Synthetic exits need the service, fresh quotes and a working broker; gaps can exceed planned loss.",
                "protectionExpiresInDays": 90,
                "protectionSessions": [
                  "regular",
                  "overnight",
                  "pre_market",
                  "after_hours"
                ],
                "resizeDown": false,
                "signalMode": "discretionary",
                "symbols": [
                  "AAPL",
                  "MSFT"
                ],
                "syntheticProtectionAccepted": true
              },
              "card_hash": "b8501cc08952e2dd486c1407cbad5d6343cf7567997311115d9734cfd3776767"
            }
          ],
          "entries": [
            {
              "client_id": "cog-order_U-8ECbeIoLTa",
              "symbol": "AAPL",
              "qty": 5,
              "status": "filled",
              "filled_qty": 5,
              "rule_id": "rule_wLDu5W4R797H",
              "error": "SIMULATED_LOST_ACK_AFTER_ACCEPTANCE"
            }
          ],
          "incidents": [],
          "connection": {
            "account_id": "acct_CPmiBMXQoFZc",
            "checked_at": 1796655600000,
            "session": "regular",
            "connected": 1,
            "expires_at": null,
            "expiry_known": 1
          },
          "exitChecks": []
        },
        "protections": [
          {
            "id": "rule_wLDu5W4R797H",
            "symbol": "AAPL",
            "status": "active",
            "state": {
              "ruleId": "rule_wLDu5W4R797H",
              "lastObservedAt": 1796655600000,
              "softBreachSince": null,
              "selling": null,
              "sellingSince": null,
              "soldQty": 0,
              "orderSeq": 0
            }
          }
        ]
      }
    },
    {
      "label": "retry after reconciliation",
      "isError": false,
      "result": {
        "outcome": "HOLD",
        "reason": "EVENT_ALREADY_ALLOCATED",
        "clientOrderId": "cog-order_U-8ECbeIoLTa",
        "status": "filled"
      }
    }
  ]
}
```

Revoked rules block new entries and keeps an owned reduction available

Record ` /results/18 ` in [verification.json](https://trygalore.com/releases/galore-gate-evaluation/0.1.0-eval.1/verification.json). Passed.

```
{
  "name": "Revoked permission blocks new entries and keeps an owned reduction available",
  "passed": true,
  "sourceRecord": "/results/18",
  "replies": [
    {
      "label": "synthetic member confirms exact card",
      "isError": false,
      "result": {
        "mandateId": "gate_kZHXI6fDnbAG",
        "status": "active"
      }
    },
    {
      "label": "member revocation",
      "isError": false,
      "result": {
        "mandateId": "gate_kZHXI6fDnbAG",
        "status": "revoked",
        "protectionPreserved": true
      }
    },
    {
      "label": "owned reduction request",
      "isError": false,
      "result": {
        "requested": true,
        "ruleId": "rule_aMB9fe1kFFEF",
        "status": "waiting_for_valid_quote_and_signed_price_floor"
      }
    }
  ]
}
```

A second account cannot read or use the first account's rules

Record ` /results/19 ` in [verification.json](https://trygalore.com/releases/galore-gate-evaluation/0.1.0-eval.1/verification.json). Passed.

```
{
  "name": "A second account cannot read or use the first account permission",
  "passed": true,
  "sourceRecord": "/results/19",
  "replies": [
    {
      "label": "synthetic member confirms exact card",
      "isError": false,
      "result": {
        "mandateId": "gate_NjdtEXAjzq-m",
        "status": "active"
      }
    },
    {
      "label": "cross-account refusal",
      "isError": false,
      "result": {
        "outcome": "BLOCK",
        "reason": "NO_SIGNED_MANDATE"
      }
    }
  ]
}
```

## A record you cannot edit is something to prove

Use one restricted writer, stable event IDs, a fixed order and a clear export and retention policy. Add corrections as new events; never erase old ones. For records others can verify, plan signatures and outside storage.

The local release does not give you an outside archive or protection from a database administrator. The [SQLite journal](https://trygalore.com/learn/prevent-duplicate-trading-orders) shows the same gap.

## A key is not a model

A unique key tells you which key acted. Shared or stolen keys blur that. Keep records of when keys are issued, rotated and turned off. Never publish a real key or account data in an example.

## Link it to the brokerage

For a brokerage adapter, agree on the brokerage's account, environment, order IDs and order states. If your AI tool already holds the brokerage connection, Galore reviews the trade but cannot enforce it or verify the receipt. [Choose a path](https://trygalore.com/developers/broker-and-ai-tool-integration).

Approved but nothing filled? [Find the last step you can prove](https://trygalore.com/learn/trade-approved-but-not-filled). A timeout stays unknown until reconciled; do not resend because the AI saw no fill.

[Run Galore locally](https://trygalore.com/developers/gate-evaluation) · [Compare approaches](https://trygalore.com/compare/pre-trade-tools) · [Pilot checklist](https://trygalore.com/developers/evaluate-pre-trade-gateway)

Reviewed 4 December 2026
