StackMap
Subscribe
Explore / fence
openai

fence

OpenAI's GitHub Action for CI hardening: bounded egress filtering and runner lockdown — the fence that keeps supply-chain attacks out and your CI-resident coding agent in.

91 7 Rust MITupdated 3 days ago
Curator's take

The tagline is the whole thesis: a fence keeps things out, but also IN — and 'in' is the part that matters once coding agents run inside your CI. One Action line before checkout gives the job a bounded egress allowlist, so a prompt-injected agent (or a compromised dependency) can't exfiltrate secrets to arbitrary hosts. It's OpenAI's own dogfood for exactly that threat. NOT mature: 91 stars, explicitly early and in active development, GitHub-hosted Linux x64 runners only, and pin-by-commit-sha is mandatory — the README itself won't let you trust a floating tag. Adopt it the way it asks to be adopted: pinned, watched, and before checkout.

Mapped by ShipWithAI editors · links verified
README.md

Fence 🛡️

lint test build acceptance action acceptance released action / ubuntu-24.04 + ubuntu-latest main / ubuntu-latest integration

A GitHub Action for hardening CI/CD pipelines with bounded egress filtering and runner lockdown.

Fence

Quick Start ⚡

Add Fence as the first step in a supported GitHub-hosted Linux job:

- uses: openai/fence@<commit-sha> # pin@vX.Y.Z

This starts Fence in block mode with an empty user allowlist on a GitHub-hosted x64 job using ubuntu-24.04 or ubuntu-latest. Replace <commit-sha> with the full action_commit value and vX.Y.Z with the tag from the same release; release notes provide the ready-to-copy line with a Dependabot-friendly # pin@vX.Y.Z comment. main is source-only and does not contain a runnable production bundle. Put Fence before checkout and any other steps you want it to constrain.

Read more: Getting started with Fence

Examples 🧪

Start with a complete job that activates Fence before checkout:

jobs:
  test:
    runs-on: ubuntu-24.04
    steps:
      - uses: openai/fence@<fence-commit-sha>
      - uses: actions/checkout@<checkout-commit-sha>
      - run: script/test

Run in audit mode first to see what would need review before enabling blocking:

- uses: openai/fence@<commit-sha>
  with:
    mode: audit

The audit summary suggests allowlist entries for observed hostnames and direct IPv4 or IPv6 destinations.

Allow GitHub artifact uploads, including GitHub Pages deployments and GitHub Actions caches, while keeping other network restrictions in place:

- uses: openai/fence@<commit-sha>
  with:
    allow_github_artifacts: true

This setting is off by default. It permits up to four exact GitHub-shaped results-storage accounts on HTTPS and makes artifact storage available to the job. Enable it only when the workflow needs artifacts: later steps may also use the permitted accounts to upload data. Fence does not allow all Azure Blob Storage.

Allow one or more HTTPS hostnames:

- uses: openai/fence@<commit-sha>
  with:
    allowlist: |
      api.example.com
      artifacts.example.com

Allow custom TCP, UDP, or CIDR destinations:

- uses: openai/fence@<commit-sha>
  with:
    allowlist: |
      registry.example.com:8443
      udp://dns.example.com:53
      cidr 192.0.2.0/24 udp 123
      cidr 2001:db8::/64 tcp 443

Keep Docker/container access available while still applying network restrictions and disabling passwordless sudo:

- uses: openai/fence@<commit-sha>
  with:
    container_policy: unsafe_preser

Continue your stack

What teams reach for next — and why each earns a place beside fence. Ranked by curator confidence.