Skip to content

Commit fcd9988

Browse files
UnitOne AgentGateway fork with MCP security guards
Fork of agentgateway (https://github.com/agentgateway/agentgateway) with: - MCP security guards (PII detection, tool poisoning, rug pull detection) - UnitOne UI customizations - Additional documentation and testing infrastructure
0 parents  commit fcd9988

608 files changed

Lines changed: 169219 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[alias]
2+
xtask = "run --package xtask --"
3+
4+
# Enable tokio_unstable for task dump
5+
# Not supported for non-linux
6+
[target.'cfg(target_os = "linux")']
7+
rustflags = [
8+
"--cfg", "tokio_unstable"
9+
]

.devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/rust:latest"
3+
}

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
target
2+
.idea
3+
.vscode
4+
.DS_Store
5+
manifests
6+
examples
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Prep Runner
2+
3+
description: Common setup steps for agentgateway actions
4+
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Free disk space
9+
shell: bash
10+
run: |
11+
echo "Before clearing disk space:"
12+
df -h
13+
docker system df -v
14+
15+
# https://github.com/actions/runner-images/discussions/3242 github runners are bad at cleanup
16+
echo "Removing large packages"
17+
time sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-chrome-stable \
18+
firefox powershell mono-devel libgl1-mesa-dri || true
19+
time sudo apt-get autoremove -y || true
20+
time sudo apt-get clean -y || true
21+
echo "Done removing large packages"
22+
df -h
23+
24+
# Clean up pre-installed tools
25+
# For some reason, GHA often takes minutes (up to 20min observed) to clean up somehow.
26+
# Presumably this is due to a slow disk?
27+
function clean-dir() {
28+
echo "Cleaning $1"
29+
time sudo rm -rf "$1" || true
30+
}
31+
# These two were found to take very very long. Even though its large, its not worth the cost
32+
# clean-dir /usr/local/lib/android # 8.9gb
33+
# clean-dir $AGENT_TOOLSDIRECTORY # 5.6gb
34+
clean-dir /usr/share/dotnet # 3.4gb
35+
clean-dir /usr/share/swift # 3.1gb
36+
clean-dir /usr/local/.ghcup # 6.3gb
37+
clean-dir /usr/local/share/powershell # 1.2gb
38+
clean-dir /usr/local/share/chromium # 600mb
39+
40+
# Clean up images
41+
docker image rm node:18 || true
42+
docker image rm node:18-alpine || true
43+
docker image rm node:20 || true
44+
docker image rm node:20-alpine || true
45+
# remove the dangling images and containers
46+
docker images | tail -n +2 | awk '$1 == "<none>" {print $3}' | xargs --no-run-if-empty docker rmi
47+
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $1}' | xargs --no-run-if-empty docker rm --volumes=true
48+
49+
echo "After clearing disk space:"
50+
df -h
51+
docker system df -v

.github/workflows/pull_request.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Branch
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
CI: true
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
include:
19+
- os: ubuntu-latest
20+
target: x86_64-unknown-linux-musl
21+
# Performance is horrendous on musl without jemalloc
22+
features: jemalloc
23+
- os: ubuntu-22.04-arm
24+
target: aarch64-unknown-linux-musl
25+
# Performance is horrendous on musl without jemalloc
26+
# TODO: arm64 build fails with jemalloc for some reason?
27+
features: default
28+
- os: macos-latest
29+
target: aarch64-apple-darwin
30+
features: default
31+
- os: windows-latest
32+
target: x86_64-pc-windows-msvc
33+
features: default
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-node@v4
38+
with:
39+
node-version: 23
40+
- name: Install Rust
41+
uses: dtolnay/rust-toolchain@stable
42+
with:
43+
targets: ${{ matrix.target }}
44+
- uses: Swatinem/rust-cache@v2
45+
# Github cache is too tiny to handle the full matrix :-(
46+
if: ${{ matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-latest' }}
47+
48+
- name: Build UI
49+
run: |
50+
cd ui
51+
npm ci
52+
npm run build
53+
- name: Install musl-tools
54+
if: ${{ matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-latest' }}
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install -y musl-tools
58+
rustup target add ${{ matrix.target }}
59+
- name: Build
60+
run: "cargo build --features ui --target ${{ matrix.target }} -F ${{ matrix.features }} --profile quick-release"
61+
62+
test:
63+
strategy:
64+
matrix:
65+
os: [ubuntu-latest, windows-latest]
66+
runs-on: ${{ matrix.os }}
67+
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: actions/setup-go@v6
71+
with:
72+
go-version: '1.25'
73+
- name: Install jq on Windows
74+
if: runner.os == 'Windows'
75+
run: choco install jq -y
76+
- name: Install protoc-gen-go on Windows
77+
if: runner.os == 'Windows'
78+
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.6
79+
- name: Install Rust
80+
uses: dtolnay/rust-toolchain@stable
81+
- uses: Swatinem/rust-cache@v2
82+
# Github cache is too tiny to handle the full matrix :-(
83+
if: ${{ matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-latest' }}
84+
- name: Add Go bin to PATH
85+
shell: bash
86+
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
87+
- name: Test
88+
run: make test
89+
- name: Validate
90+
run: make validate
91+
92+
lint:
93+
runs-on: ubuntu-latest
94+
95+
steps:
96+
- uses: actions/checkout@v4
97+
- uses: actions/setup-go@v6
98+
with:
99+
go-version: '1.25'
100+
- uses: actions/setup-node@v4
101+
with:
102+
node-version: 23
103+
- name: Install Rust
104+
uses: dtolnay/rust-toolchain@stable
105+
- uses: Swatinem/rust-cache@v2
106+
- name: Add Go bin to PATH
107+
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
108+
- name: Generation
109+
run: git config --global core.autocrlf true; make gen check-clean-repo
110+
- name: Lint
111+
run: make lint
112+
- name: Lint UI
113+
run: |
114+
cd ui
115+
npm ci
116+
npm run lint

0 commit comments

Comments
 (0)