Start / Ask your first question
Ask your first question
Issue a gateway key, ask Caroline one question, and find the answer in the ledger. About five minutes.
A policy author's account on a Caroline installation, and its PDP address (for example https://pdp.example.com). The examples use the AI Agents pack; any pack works with its own ids.
- Sign inOpen your installation and sign in with your author name and passphrase, or with Google or Microsoft where your installation offers them.
- Issue a gateway keyOpen Keys and choose + New gateway. Give it an id of lowercase letters, digits and hyphens, such as
my-first-gateway, a name, a name for its key and why, then Add it and make its key. The key is shown once. Keep it in a secret store or a file only you can read. - AskSend one evaluation with the key.
Ask
# the key from step 2, read from a file, never typed on the command line
KEY=$(cat ~/.caroline/my-first-gateway.key)
curl -s https://pdp.example.com/access/v1/evaluation \
-H "Authorization: Bearer $KEY" \
-H 'Content-Type: application/json' \
-d '{
"subject": {"type": "agent", "id": "a_supply_agent"},
"action": {"name": "read"},
"resource": {"type": "inventory", "id": "r_stock_azure_prod"},
"context": {"on_behalf_of": "u_plan_mia"}
}'
import json, pathlib, urllib.request
key = pathlib.Path.home().joinpath(".caroline/my-first-gateway.key").read_text().strip()
body = {
"subject": {"type": "agent", "id": "a_supply_agent"},
"action": {"name": "read"},
"resource": {"type": "inventory", "id": "r_stock_azure_prod"},
"context": {"on_behalf_of": "u_plan_mia"},
}
req = urllib.request.Request(
"https://pdp.example.com/access/v1/evaluation",
data=json.dumps(body).encode(),
headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
)
with urllib.request.urlopen(req, timeout=2) as r:
answer = json.load(r)
allowed = answer.get("decision") is True # exactly true, nothing else
The answer is true: the Supply agent may read Azure stock for Mia. Change the resource to r_stock_ibm_prod and ask again: false, with the rule that refused it in context.reason.
See it in Decisions
Open Decisions in Caroline. Both questions are there, newest first, with the gateway my-first-gateway, its key id, the outcome and the rule. Open one to see its record in the ledger.
Revoke
Back in Keys, find the gateway's card, choose Revoke on its key, give a reason, then Revoke for good. Revocation is final and recorded, and the engine honours it within a second or so. Ask again: 401 invalid_token.
Put the same call in front of real tool calls with the MCP gateway, or write a rule of your own with your first rule.