Browse the documentation

Docs Guides

Watch with Guard, then stop rule-breaking calls

Guard first only watches. You see what it would have stopped, and only then do you decide whether it should stop calls. This guide covers both steps, in the workspace and in a terminal.

On this page

Before you start#

  • Guard is for trying in development and staging. It has not been qualified for production traffic.
  • Guard's policy is built from the rules you have reviewed. Review them first on the Rules tab with Use this rule. A rule that Guard cannot decide from a single call is listed with the reason instead of being approximated.
  • Guard only sees calls that go through it. See Guard.

Set Guard up to watch#

  1. Open the Live room.
  2. Read The rules Guard can watch. These come from the rules you use. Guard checks each call your agents make to these tools against them. Under Guard cannot stop these before they happen you find the rules it cannot cover, each with its reason.
  3. Under Answer one question, choose to watch (recommended) or not now. If you choose to watch, you can fill in Where do your tools run?: the address of the real tool, as host:port for plain HTTP or https://host for a service with a certificate that your computer trusts. You can add it later.
  4. Press Set up Guard. This writes files only. Nothing starts yet.
  5. Press Start watching on this computer. Guard starts as its own program. While it watches, every call still goes through, and it records what it would have stopped. If Guard does not know where the tool runs yet, it cannot start, and says so.

From a terminal, in your project folder:

Terminal
geo guard setup                    # shows the proposal and asks the one question
geo guard setup --answer watch --upstream <host:port>
geo guard start
geo guard status

Without --answer, geo guard setup only shows the proposal. --answer watch applies it. To start Guard again after a crash with backoff, use geo guard start --supervise. On a Mac, geo guard login-item --confirm starts Guard, supervised, when you log in. Without --confirm it shows what it would write, and it is never loaded for you.

Point your agent at Guard#

Change the address your agent uses for that tool so that it calls Guard instead of the tool. Each agent calls Guard with its own credential. geo guard agent-credential issues a new one, optionally expiring after some hours, and prints it once. Calls without a valid credential are refused, even while Guard only watches. The Guard screen says "No calls yet" until the first call arrives.

Read what it would have done#

Open the Guard screen and look at Recent calls. A red marker is a call Guard stopped. An amber marker is one it would have stopped or held. Under Not confirmed yet you see calls the tool has accepted but has not confirmed. Under What Guard stops, and what it cannot you find, for each tool, what is stopped before the call is sent, what needs the tool's help, and what cannot be checked before a call.

The Record (Prove) screen shows the same calls as entries in the record. From a terminal, geo prove incidents lists Guard calls that were stopped, held or would have been stopped.

Watching is also evidence. At the autonomy levels, days of watching in shadow count towards a level. See Autonomy levels.

Try a limit on past calls#

Before you hold or stop calls above an amount, use Try a limit on past calls: choose an action, whether to Hold calls above an amount for approval or Stop calls above an amount, the amount and the period (7, 30 or 90 days), and press Try it. Geometer counts the calls considered, how many would go ahead, how many would be held and how many would be stopped. Calls with no recorded amount are counted and named. Nothing is changed.

Decide to stop rule-breaking calls#

When you have seen what Guard would have stopped and you are satisfied:

  1. On the Guard screen, under Stop rule-breaking calls in production, press Set up stopping…. The button appears while Guard is only watching.
  2. Read the question Stop rule-breaking calls in production? Guard will refuse calls that break your rules and hold large ones until you approve them. Calls that reach your tools another way are not seen and are not stopped. If Guard cannot decide, it refuses the call unless you chose otherwise.
  3. Press Yes, set it up to stop calls. You become the approver for that tool. Add others under Who can approve.
  4. Restart Guard to apply the change. The workspace says "Guard is set up to stop calls. Restart it to apply."

From a terminal:

Terminal
geo guard promote --confirm-production
geo guard stop
geo guard start

The word "production" in the command is the name of Guard's stopping mode. It does not mean that Guard is ready for production traffic. geo guard promote without --confirm-production does nothing.

Controls you can use at any time#

  • Stop all new calls… (geo guard kill) and Allow calls again (geo guard kill --off). Anything already sent is not undone.
  • Stop one agent's new calls without stopping the others (geo guard agent-stop <agent>, with --off to allow them again).
  • Accept or reject a tool whose definition changed (geo guard tool-review <name> --accept or --reject).
  • Settle calls whose outcome is uncertain from the provider's own records (geo guard reconcile). Nothing is sent again.
  • Back up Guard's store and evidence into a folder (geo guard backup --to <folder>).

Something unclear, wrong or missing on this page? Report a problem with these docs.