Skip to content
Edge docs Early access

Put Edge in front of your routes, inside your app.

Install the SDK for Node.js, Python, Go or Java, add two lines, and see which agents, crawlers and bots use your site. Nothing is refused until you choose.

Quickstart · Node.js
import express from "express";
import { createEdge } from "@securespace-club/edge";

const app = express();
const edge = createEdge(); // reads SECURESPACE_EDGE_KEY
app.use(edge.middleware());
Quickstart

From sign-up to your first report.

  1. 01

    Sign up and choose Edge

    One account covers Gateway and Edge.

  2. 02

    Add a site

    Name it, list its paths, and set rules per path in the console under Sites.

  3. 03

    Create an Edge key

    Shown once. Put it in SECURESPACE_EDGE_KEY on your servers.

  4. 04

    Install the SDK and add two lines

    Your site now reports in monitor mode: nothing is refused.

  5. 05

    Watch, then enforce

    Read Activity and the heat map. Turn on enforcement when you are ready.

Install

Four languages, one decision engine.

Every SDK runs the same shared decision engine, checked against the same test cases, so a rule decides identically in each. None adds a framework dependency to your app.

Node.js 20+
npm install @securespace-club/edge
Python 3.9+
pip install securespace-edge
Go 1.22+
go get securespace.club/edge
Java 17+ (Maven)
<dependency>
  <groupId>club.securespace</groupId>
  <artifactId>securespace-edge</artifactId>
  <version>0.1.0</version>
</dependency>
Frameworks

Wire it into the framework you run.

Add Edge first, before your routes and authentication, so it sees every request. Express is shown in the quickstart above.

Fastify
const edge = createEdge();
app.addHook("onRequest", edge.fastify());
Next.js middleware, or any Fetch API handler
import { createEdge } from "@securespace-club/edge";
const edge = createEdge();

export default edge.wrap(async (request) => handle(request));
Hono
app.use("*", edge.hono());
Plain node:http
http.createServer(async (req, res) => {
  if (await edge.protect(req, res)) return; // Edge already answered
  handle(req, res);
});
Django (settings.py)
MIDDLEWARE = [
    "securespace_edge.django.EdgeMiddleware",  # first
    # ... your other middleware
]
Flask
from securespace_edge.flask import protect

app = Flask(__name__)
protect(app)  # reads SECURESPACE_EDGE_KEY
FastAPI, Starlette, any ASGI app
from securespace_edge import SecureSpaceEdge, EdgeASGI

app.add_middleware(EdgeASGI, edge=SecureSpaceEdge())
Gin
import "securespace.club/edge/edgegin"

e := edge.New(edge.Options{})
router.Use(edgegin.Middleware(e))
Echo
import "securespace.club/edge/edgeecho"

e := edge.New(edge.Options{})
app.Use(edgeecho.Middleware(e))
Spring Boot
@Bean
FilterRegistrationBean<EdgeFilter> edgeFilter() {
  var bean = new FilterRegistrationBean<>(new EdgeFilter(new Edge(new Edge.Options())));
  bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
  return bean;
}
Any Servlet container (web.xml or @WebFilter)
servletContext
  .addFilter("securespace-edge", new EdgeFilter(new Edge(new Edge.Options())))
  .addMappingForUrlPatterns(null, false, "/*");
Configuration

Environment variables.

Behind a load balancer or CDN, tell Edge which header carries the real client address (trustedIpHeader, trusted_ip_header or TrustedIPHeader).

VariablePurpose
SECURESPACE_EDGE_KEYThe site's Edge key, from the console.
SECURESPACE_EDGE_HASH_KEYYour own hashing key. Addresses and cookies are hashed with it before leaving your server; SecureSpace never sees it.
SECURESPACE_EDGE_MODE=offKill switch: pass every request through, with no network at all.
SECURESPACE_EDGE_URLOnly for testing against a non-production scoring service.
Modes

Monitor, enforce, off.

ModeWhenWhat the SDK does
monitorDefault, and the free planWorks out every decision and records what it would do. Always serves the request.
enforcePaid plansApplies the decision. A new or changed rule still starts log-only, so turning enforcement on never makes a brand-new rule refuse anyone.
offKill switchPasses everything through. Set in the console (within 60 seconds) or by environment variable (at start-up).
What visitors get

Four answers, each with a way forward.

The ladder only goes up: a rule or a model can move a visitor towards block, never back. For people's browsers you can render your own page instead of JSON.

DecisionStatusBody and headers
allowYour handler runsNothing is added.
throttle429Retry-After in seconds, and a JSON body with reason and retryAfter.
raise401WWW-Authenticate: SecureSpace-Agent, and a JSON body listing the ways to identify: a signed request, an agent token, or a proof of work.
block403A JSON body with a reason code and a support reference, never the rule itself.
401 body when Edge asks a visitor to identify
{
  "error": "identify_required",
  "message": "This site lets AI agents in when they identify themselves.",
  "ways": [
    { "kind": "signed_request", "spec": "web-bot-auth" },
    { "kind": "agent_token", "issuer": "https://you.example/.well-known/agent-auth" },
    { "kind": "proof_of_work", "challenge": "<opaque>", "difficulty": 18 }
  ],
  "policy": "https://you.example/.well-known/agent-policy.json",
  "reference": "edg_7Qm2..."
}
Agent sign-in

Let your users' agents in by name.

Your own login issues agent tokens (JWTs) for the agents your users connect. Edge verifies them locally against your keys and knows which agent it is and which person it acts for. A 24-hour pause stops that agent only; the person stays signed in.

  • Agents that sign requests with Web Bot Auth are verified without any setup.
  • Your rules are published at /.well-known/agent-policy.json for agents to read.
  • An anonymous script can pass a raise by solving the proof of work it was sent.
Node.js · accept agent tokens from your login
const edge = createEdge({
  agentTokens: {
    issuers: [
      {
        issuer: "https://you.example",
        audience: "https://you.example/api",
        jwksUrl: "https://you.example/.well-known/jwks.json",
      },
    ],
  },
});
Purchases

Check an agent's purchase when you charge.

Set purchase routes, a ceiling and a currency per site in the console. Edge cannot read a request body, so your checkout handler passes the amount. An agent needs a purchase claim in its token: true, or a limit such as { "max": 5000, "currency": "INR" }. Without it, or over a limit, the agent is asked to step up, never refused.

Node.js · checkPurchase
// In your checkout handler, at the moment of charging:
const answer = edge.checkPurchase(req, { amount: 4200, currency: "INR" });
if (!answer.allowed && answer.refusal) {
  const { status, headers, body } = answer.refusal; // asks the agent to step up
  return res.writeHead(status, headers).end(body);
}
Privacy

What leaves your server, and what never does.

Edge sends request metadata: method, path pattern, timing, header names and a few header values. Addresses, cookies and user identifiers are hashed with your key first. Request and response bodies are never read.

Good to know

Behaviour that may surprise you.

  • If SecureSpace is slow or unreachable, Edge serves the request. Protection drops; your site does not.
  • Edge refreshes its signed rules every 60 seconds and keeps the last good set if a refresh fails.
  • People's browsers below 8 requests a minute are not watched at all, and cost no memory.
  • Verified crawlers and signed-in agents are never scored as strangers.
  • Errors inside Edge are reported to SecureSpace and never reach your visitors.
Early access

Ready to see who visits?

Sign up, choose Edge, and we will set up your first site with you in monitor mode.