|

Akamai

An EdgeWorker that uses Akamai Bot Manager classification to detect AI bot traffic and fire content_retrieved events using the fire-and-forget pattern.

Enterprise EdgeWorkers source_role: edge

How it works

flow
AI Bot ──GET──> Akamai Edge (EdgeWorker)
                    │
                    ├── Bot Manager classifies request
                    │   (bot category, score, verified status)
                    │
                    ├── EdgeWorker reads classification + OA-Telemetry-ID
                    ├── Serves content (no delay)
                    └── httpRequest() fire-and-forget
                        └── POST to OA telemetry endpoint

Akamai EdgeWorkers support httpRequest() for outbound subrequests. The fire-and-forget pattern is explicitly documented by Akamai - call httpRequest() without await and the subrequest executes asynchronously. If it fails, execution continues without error.


EdgeWorker

main.js
import { httpRequest } from 'http-request';

export function onClientRequest(request) {
  // Read Akamai Bot Manager classification
  // Bot Manager sets variables via Property Manager rules
  const botCategory = request.getVariable('PMUSER_BOT_CATEGORY') || '';
  const isAiBot = botCategory.includes('AI') || botCategory.includes('SCRAPER');

  if (isAiBot) {
    const ua = request.getHeader('User-Agent')?.[0] || '';
    const isVerified = request.getVariable('PMUSER_BOT_VERIFIED') === 'true';

    const event = {
      type: 'content_retrieved',
      timestamp: new Date().toISOString(),
      content_url: `https://${request.host}${request.path}`,
      source_role: 'edge',
      oa_telemetry_id: request.getHeader('OA-Telemetry-ID')?.[0] || undefined,
      data: {
        user_agent: ua,
        bot_category: botCategory.includes('FETCH') ? 'inference' : 'training',
        verified: isVerified,
      },
    };

    // Fire and forget - no await
    httpRequest('https://telemetry.openattribution.dev/v1/events', {
      method: 'POST',
      headers: { 'Content-Type': ['application/json'] },
      body: JSON.stringify({
        events: [event],
        org_id: 'your-org-id',
      }),
    });
  }
}
Bot Manager integration
Two paths to access Bot Manager data in EdgeWorkers. With Bot Manager Premier, use the onBotSegmentAvailable event handler and the request.botScore object for direct access to classification. Alternatively, configure Property Manager to surface Bot Manager categories as PMUSER_ variables (must be UPPERCASE) that EdgeWorkers read via request.getVariable(). The variable names above are illustrative - your Akamai account team can help map the right categories.

Bot detection

Akamai Bot Manager handles 150+ billion bot requests daily. It classifies requests using behavioural analysis, device fingerprinting, TLS fingerprints, IP reputation, and user agent analysis. Bot Manager maintains its own classification of AI crawlers and updates it as new agents appear - no hardcoded bot list to maintain in your EdgeWorker.


Deployment

EdgeWorkers are deployed via Akamai Control Center or API. There is no self-serve marketplace - deployment typically involves the Akamai account team enabling EdgeWorkers on your property.

Enterprise distribution
Akamai's customer base is heavily enterprise with managed services. For a streamlined deployment, contact your Akamai account team or reach out to OpenAttribution and we can coordinate with Akamai's technology partner programme.

Existing precedents

TollBit and Skyfire have a joint integration with Akamai for AI bot monetisation at the edge. HUMAN Security and Queue-it also distribute through EdgeWorkers. The fire-and-forget telemetry pattern is purpose-built for this use case.