Integrate with your coding agent
A small, verifiable integration you or your coding agent can complete through the existing dashboard sections.
Start by protecting one operation in your application. Your backend asks ReQlo for permission immediately before that operation executes. ReQlo responds with allow, deny, or approval required.
The Copy instructions for your agent button on the homepage and documentation landing page copies the same implementation checklist. Paste it into your coding agent with this task:
Protect one existing tool in this application using these ReQlo instructions.
Inspect the code first, implement the integration, and test that denied actions never execute.
Explain any dashboard configuration I still need to complete. Do not ask me to paste secret keys into chat.The instructions are also available as plain text. They tell the agent to inspect your project, read the relevant docs, use compatible SDK methods, preserve your authentication, implement the check, and prove its failure behavior. If the agent cannot reach a localhost or protected preview URL, give it access to the matching repository docs or an accessible docs URL. It should identify that limitation rather than invent APIs.
What you need
- Access to a ReQlo workspace and its Sandbox environment.
- An owner/admin who can publish the policy and create or provide your current project key.
- A backend that runs the protected operation. Keep the secret key there, including in a serverless function if your application needs one. Frontend code must call that backend rather than hold the key.
- The SDK for your application's language, or the HTTP API. For the Node.js example below, use the published TypeScript 0.3.0 installation in the Quickstart.
TypeScript 0.4.0 is available in the repository but is not published. The example here uses enforce, which is
available in 0.3.0. Use the local archive instructions in the quickstart only when you deliberately choose the
checkout's newer protect, execute, resume or approvals.wait helpers and the matching updated API.
Five terms, with one example
| Term | Meaning | Example |
|---|---|---|
| Agent | The workload requesting an action | Your assistant's registered agt_… ID |
| Project key | A secret your backend uses to contact ReQlo | Stored as REQLO_API_KEY |
| Action | The operation you want to protect | records.read |
| Resource | The specific object affected | Record record_demo |
| Policy | Rules deciding whether the action may proceed | Allow the user to read their own records |
The subject is the person the agent acts for. Take it from your verified session. Attributes are facts your policy checks, such as the record owner's ID. Load authoritative facts on your backend. An agent ID alone does not prove which user is signed in or what they own.
Configure one Sandbox action
Use these existing dashboard sections:
- Agents: add or select your agent and copy its public Agent ID. This creates an identity, not an API key.
- Actions & resources: register resource type
record, with a requiredowner_idattribute of type id. Register actionrecords.read, using that resource type and no context fields. - Policies: create a policy with the JSON rules below, replacing the agent placeholder. Save a draft.
- Policies → Test a decision, in the updated dashboard: choose your draft and test the request used in the script below. Matching owner and subject should allow; a different owner should deny. Previews do not execute tools or record runtime decisions. Other published policies also apply; use an isolated project for this example.
- Have an owner/admin review and publish the policy. A draft alone does not authorize runtime actions.
- API keys: create or use your current Sandbox project key separately. Keep it in the backend environment. There is one current key per user/project; agents in that project use it.
[
{
"id": "allow-owned-records",
"effect": "allow",
"actions": ["records.read"],
"agents": { "ids": ["<YOUR_AGENT_ID>"] },
"subjects": { "kinds": ["user"] },
"condition": "resource.attributes.owner_id == subject.id"
}
]For your real integration, substitute your actual action and resource names. Register those names and their fields before sending requests. Optional policy templates help assemble draft rules from your catalog; they do not infer or grant your application's existing user permissions.
Run a small proof
Place the real values in your backend environment, keeping local environment files ignored. These are placeholders, not working credentials:
REQLO_API_KEY=<YOUR_SANDBOX_PROJECT_KEY>
REQLO_AGENT_ID=<YOUR_REGISTERED_AGENT_ID>
REQLO_API_URL=https://api.reqlo.io/v1Create check.mjs in a server-side Node.js application with the SDK installed:
import { Reqlo, ReqloDeniedError } from "@reqlo/sdk";
if (!process.env.REQLO_API_KEY || !process.env.REQLO_AGENT_ID) {
throw new Error("Set REQLO_API_KEY and REQLO_AGENT_ID on your server first.");
}
const reqlo = new Reqlo({
apiKey: process.env.REQLO_API_KEY,
baseUrl: process.env.REQLO_API_URL ?? "https://api.reqlo.io/v1",
});
let executions = 0;
for (const ownerId of ["user_demo", "another_user"]) {
try {
const result = await reqlo.enforce({
agent: { id: process.env.REQLO_AGENT_ID },
subject: { id: "user_demo", kind: "user" },
action: "records.read",
resource: { type: "record", id: "record_demo", attributes: { owner_id: ownerId } },
}, async () => {
executions += 1;
return { simulated: true };
});
console.log("Allowed", result);
} catch (error) {
if (error instanceof ReqloDeniedError) {
console.log("Stopped", error.decision.reason_code);
} else {
throw error; // Service/configuration failures stop the operation too.
}
}
}
if (executions !== 1) throw new Error("Expected exactly one simulated execution. Check the policy setup.");
console.log("Passed: one allowed operation, zero executions for the denied request.");Using Node.js 22.22+ and a local .env file:
node --env-file=.env check.mjsExpect one simulated execution, a stopped request, and the final passed message. For a local API, set
REQLO_API_URL to its configured loopback address, such as http://127.0.0.1:8080/v1. Runtime decisions appear in
Observability. This script simulates a tool; it does not test access to your real database or external provider.
Put the check inside the real tool
Replace the simulated callback with the actual operation. Before building the request, authenticate the calling workload, verify the user's session, and look up the target object and its authoritative attributes on your server. Keep your application's existing access checks. Never accept an owner ID, role, subject or target environment from an LLM as proof of authority.
Have your coding agent test allow, deny, pending approval, malformed responses, missing configuration and network failure with mocked operations. Every case except explicit allow must execute the tool zero times. If another route can call the tool directly, it must enforce the same checks too.
For a remote MCP client that calls tools outside your backend, use the MCP gateway. For human review, follow Human approvals and retain the exact operation in a trusted job store. A webhook notification alone never authorizes execution.
When something does not work
| Symptom | Check next |
|---|---|
| SDK method is missing | Check the installed version. Checkout-only 0.4.0 methods are not in 0.3.0 |
action_unknown | Register that exact action in the key's environment and ensure it is active |
attribute_invalid | Match the registered resource type, required fields and value types |
no_matching_policy | Check the published policy, agent selector, subject and conditions |
policy_denied | Inspect the matching deny rule; a separate allow cannot override it |
approval_required | Leave the tool stopped and follow the approval lifecycle |
| Authentication error | Check that the backend has the correct current key; do not print it |
| Timeout or network error | Check the API address and service availability; keep the tool stopped |
What your coding agent should hand back
Ask for the files changed, commands to install/run/test, environment variable names, exact dashboard steps and the expected outcomes. It should explain where the check runs, cite the docs it actually used, and distinguish mocked results from verified Sandbox behavior. If it lacks access or credentials, it should finish the code and identify the remaining verification step without claiming the integration is already working.
Something wrong or unclear? Report an issue with this page.