Copy the full commit SHA and matching version from a Fence release. Add Fence before checkout and the rest of your job.
Fence blocks unexpected outbound connections by default:
- uses: openai/fence@<commit-sha> # pin@vX.Y.ZIt also disables passwordless sudo, Docker, and container access.
Record which connections your job needs without blocking them:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
mode: auditCheck the job summary, add the required hostnames or IP addresses to your allowlist, and switch back to block mode.
A hostname without a port uses TCP port 443:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
allowlist: |
api.example.com
artifacts.example.comHostnames, custom ports, IP addresses, and network ranges can share one allowlist:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
allowlist: |
registry.example.com:8443
tcp://cache.example.com:9443
udp://dns.example.com:53
ip 192.0.2.10 tcp 443
ip 2001:db8::10 udp 53
cidr 192.0.2.0/24 udp 123
cidr 2001:db8::/64 tcp 443See the allowlist guide for limits, supported formats, and validation rules.
Allow GitHub Actions storage when your job needs artifacts, GitHub Pages, or caches:
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
allow_github_artifacts: true
- uses: actions/checkout@<checkout-commit-sha>
- run: script/build
- uses: actions/upload-artifact@<upload-artifact-commit-sha>
with:
name: build-output
path: dist/Important
Later workflow steps can use the same storage access to send data out of the runner. Enable this option only when the job needs it.
Keep container access available when your job requires Docker or containerd:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
container_policy: unsafe_preserve
allowlist: |
auth.docker.io
registry-1.docker.ioImage pulls may also need registry, layer, or storage domains. Use audit mode to identify them.
Warning
Keeping Docker access weakens runner isolation.
Use one or two * labels to match specific hostname depths:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
allowlist: |
*.docker.io
*.*.example.com*.docker.io matches auth.docker.io, but not docker.io or one.two.docker.io. All wildcard entries share a limit of eight unique matched hostnames per job.
Remove optional GitHub website, API, release, and application destinations:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
disable_broad_github_domains: trueGitHub Actions can still report job status and finish the run. Steps such as actions/checkout may need github.com added back to your allowlist.
Fence chooses its supported platform profile automatically. Set it explicitly only if your workflow needs to:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
platform_profile: github_hosted_workflow_bootstrap_v5Other profile values are not supported.
Use raw JSON only when you need the advanced configuration format:
- uses: openai/fence@<commit-sha> # pin@vX.Y.Z
with:
config: >-
{"schema_version":1,"mode":"block","invocation_id":"my-job-1","allowlist":[]}The config input cannot be combined with native inputs such as allowlist or mode. Most jobs should use native inputs and let Fence choose the invocation ID.
For the complete configuration contract, see the v0 specification.