AGENT SKILL

web2-api-firewall-administrator

Guides configuring Bastion Web2 API adapter policies for the Trust Runtime. Covers endpoint allowlists, provider budgets, rate limits, content inspection (PII/secrets detection), header filters, and OpenAPI spec-based auto-configuration. Use when configuring API call security for AI agents, setting provider spending caps, inspecting outbound API traffic, or setting up the Web2 adapter.

License 许可
Apache-2.0
所属仓库
zkos-labs/bastion
最近更新
2026-11-13
Stars
★ 3
Forks
1

01 前言 Front Matter

name
web2-api-firewall-administrator
description
Guides configuring Bastion Web2 API adapter policies for the Trust Runtime. Covers endpoint allowlists, provider budgets, rate limits, content inspection (PII/secrets detection), header filters, and OpenAPI spec-based auto-configuration. Use when configuring API call security for AI agents, setting provider spending caps, inspecting outbound API traffic, or setting up the Web2 adapter.

03 SKILL.md 正文

Bastion Web2 API Adapter - Administrator Guide

This skill covers configuring the Bastion Web2 API adapter for AI agents calling external REST/gRPC/GraphQL APIs (OpenAI, Stripe, Slack, GitHub, AWS, etc.).

Architecture

Agent → Bastion Proxy (crates/web2-firewall) → Target API
         └─ Policy Engine (crates/core)
         └─ GrondOSINT threat scoring
         └─ Audit logging (Sled DB)

Integration Modes

Mode How Best for
Proxy Agent HTTP calls through localhost:4000 Single-agent, dev
SDK BastionWeb2Client wrapper (TypeScript) LangChain, Vercel AI SDK, CrewAI
Ingest Log-only mode, send events after the fact Monitoring, gradual rollout

API Endpoints

Method Path Purpose
POST /proxy Proxy an API call through policy evaluation
POST /api/v2/evaluate Evaluate without proxying
GET /policy Current proxy policy
POST /policy/full Update proxy policy
GET /proxy/logs Web2 audit logs
GET /proxy/stats Usage statistics

Policy Rules

EndpointAllowlist

{ "type": "endpoint_allowlist", "paths": ["/v1/chat/completions"], "methods": ["POST"] }

ProviderBudget

{ "type": "provider_budget", "provider": "openai", "maxUsdCentsPerWindow": 5000, "windowMinutes": 1440 }

ContentInspection

{ "type": "content_inspection", "detectPII": true, "detectSecrets": true, "detectPromptInjection": true }

SDK Quick Start

import { BastionWeb2Client } from "@zkos-labs/bastion-web2";

const client = new BastionWeb2Client({
  proxyUrl: "http://localhost:4000",
  apiKey: "your-api-key",
});

const req = client.buildRequest("POST", "https://api.openai.com/v1/chat/completions", {
  "Content-Type": "application/json",
}, JSON.stringify({ model: "gpt-4o", messages: [] }));

const result = await client.evaluate(req);
if (result.decision === "pass") {
  // Proceed with the API call
}

Provider Detection

URL pattern Provider
api.openai.com openai
api.stripe.com stripe
api.github.com github
slack.com/api slack
amazonaws.com aws

Related Skills

  • bastion-how-to-use - Blockchain transaction firewall (same policy engine)
  • api-risk-scoring - Score API endpoints for security risk
  • api-budget-optimizer - Analyze and optimize API spend

04 同仓库更多 Skills

zkos-labs
zkos-labs/bastion

bastion

Programmable Trust Runtime for Autonomous Systems. Orchestrates identity, policy, privacy, durable execution, and multi-chain settlement.

★ 3
zkos-labs
zkos-labs/bastion

transaction-screening-workflow-concepts

Educational map of transaction-centric compliance screening-transfer as the atomic unit, deposit vs withdrawal direction, single and CSV import, transaction list and detail views, per-transfer screening, rescreen, and STR-style exports. Use when the user asks how monitoring UIs treat tx hashes, directions, or regulatory reporting hooks-not for legal filing advice or evading reporting.

★ 3
zkos-labs
zkos-labs/bastion

solana-tracing-specialist

Guides Solana-specific on-chain forensics-ATA resolution, SPL instruction parsing, transaction history via RPC and indexers (e.g. Helius-style APIs), fund-flow graphs, Solana clustering heuristics, and program authority review. Use when the user investigates Solana wallets, SPL tokens, DEX/Jito flows, rug or phishing patterns on Solana, or needs evidence-structured tracing reports with public data only.

★ 3
zkos-labs
zkos-labs/bastion

solana-onchain-intelligence-resources

Companion to blockint-skills Solana work-official doc indexes and stacks for RPC/indexers, sanctions and address intel MCP, web research, agent payments, graph UIs, Solana Foundation dev skills, Solana Policy Institute (policy/regulatory education), optional open-source Scrapy collection (BlockchainSpider), Impersonator Solana (dApp dev/testing), coral-xyz sealevel-attacks (security pattern examples), Neodyme Solana Security Workshop (workshop.neodyme.io), and Osec Solana auditor introduction blog (osec.io). Use when the user needs pointers to Helius, Range AI, Tavily, PayAI x402, React Flow, Solana.com skills, or SPI alongside on-chain forensics-not as a substitute for reading current provider docs, legal counsel, or API keys.

★ 3
zkos-labs
zkos-labs/bastion

solana-defi-vulnerability-analyst-agent

Guides discovery and documentation of Solana DeFi protocol risks from public code and chain state-Anchor/native programs, PDAs, CPIs, oracles, pools, SPL mechanics, and historical tx reconstruction. Use when the user asks for Solana program security review, DeFi vulnerability triage, PDA or CPI safety, oracle or liquidity-pool risk, launchpad/bonding-curve issues, or evidence-backed severity findings without exploits or private keys.

★ 3
zkos-labs
zkos-labs/bastion

solana-clustering-case-study-agent

Turns advanced Solana clustering work into complete, shareable public case studies-seed selection, multi-layer graphs, narrative arcs, visual evidence packs, and reproducible exports (CSV, queries). Use when the user wants a Solana rug/Sybil/sniper/phishing case study, X/thread writeup, educational fraud exposé from on-chain data, or timestamped evidence package built from clusters and heuristics.

★ 3