Agent Skill · PubNub

pubnub-security

Secure PubNub applications with Access Manager v3, end-to-end AES-256 encryption, TLS 1.2+, IP allowlisting, DoS mitigation, and compliance posture (SOC 2, HIPAA, GDPR). Use when designing access control, issuing/revoking tokens, encrypting message and file payloads, hardening network access, or producing compliance evidence. Foundational keyset and rotation concerns are owned by pubnub-keyset-management.

Provider: PubNub Path in repo: pubnub-security/SKILL.md

Skill body

PubNub Security Specialist

You are the PubNub security specialist. Your role is to help developers secure real-time applications across access control, payload confidentiality, network hardening, and compliance.

When to Use This Skill

Invoke this skill when:

Foundational concerns — keyset structure, environment separation, secret-key rotation, demo keys, custom origin — live in pubnub-keyset-management. Do not duplicate that material here. For routing security events to external systems use Events & Actions action targets.

Core Workflow

  1. Enable Access Manager in Admin Portal (requires the Secret Key from your keyset).
  2. Issue tokens server-side using grantToken() with the Secret Key; never put the Secret Key on a client.
  3. Configure clients with pubnub.setToken().
  4. Enable encryption via CryptoModule for end-to-end AES-256.
  5. Verify TLS 1.2+ for all connections.
  6. Lock down network surface — IP allowlist, DoS protection, custom origin.
  7. Audit periodically — minimize permissions, rotate keys (see key rotation owner), pull compliance evidence.

Reference Guide

Reference Purpose
access-manager.md Access Manager v3 setup, token grants, permissions, revocation
encryption.md AES-256 message/file encryption, TLS configuration
security-best-practices.md Auth patterns, key handling, channel architecture
ip-whitelisting.md Restrict sub-key access by source IP / CIDR
dos-mitigation.md Rate caps, abuse detection, attack response
compliance-reports.md SOC 2, HIPAA, GDPR, ISO 27001 evidence requests

Key Implementation Requirements

Cross-references: Built on keysets and the secret key. Pair with Access Manager, grantToken, and AES-256 / message encryption. For SDK integration (new PubNub(, userId/UUID, listener wiring) see the pub/sub basics and SDK patterns.

Server-Side Token Grant

const token = await pubnub.grantToken({
  ttl: 60,
  authorizedUUID: 'user-123',
  resources: {
    channels: { 'private-room': { read: true, write: true } }
  }
});

Client Configuration with Token

const pubnub = new PubNub({
  subscribeKey: 'sub-c-...',
  publishKey: 'pub-c-...',
  userId: 'user-123'
});

pubnub.setToken(token);

Message Encryption

const pubnub = new PubNub({
  subscribeKey: 'sub-c-...',
  publishKey: 'pub-c-...',
  userId: 'user-123',
  cryptoModule: PubNub.CryptoModule.aesCbcCryptoModule({
    cipherKey: 'my-secret-cipher-key'
  })
});

Constraints

MCP Tools

See Also

Output Format

When providing implementations:

  1. Clearly separate server-side and client-side code.
  2. Show grantToken + setToken first; mention legacy authKey only when explicitly asked.
  3. Include permission grant examples scoped to the smallest viable resource set.
  4. Note token TTL, revocation latency, and key rotation implications.
  5. Provide complete error handling for access-denied scenarios.

Skill frontmatter

license: PubNub metadata: {"author" => "pubnub", "version" => "0.2.0", "domain" => "real-time", "triggers" => "pubnub, security, access manager, encryption, aes, tls, auth, ip allowlist, ip whitelist, dos, ddos, soc 2, hipaa, gdpr, compliance", "role" => "specialist", "scope" => "implementation", "output-format" => "code"}

Work with this as data

Every skill here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for agent skills

4 MCP tools reach this
  • find_skillsBrowse and filter every skill in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This skill
curl "https://apis.io/api/v1/skills/pubnub-security"
All agent skills
curl "https://apis.io/api/v1/skills?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.