Skip to content

fix(security): address all 24 security findings across codebase #91

fix(security): address all 24 security findings across codebase

fix(security): address all 24 security findings across codebase #91

name: Policy Validation
on:
push:
branches: [main]
paths:
- "**/*.yaml"
- "**/*.yml"
- "packages/agent-os/src/agent_os/policies/**"
pull_request:
branches: [main]
paths:
- "**/*.yaml"
- "**/*.yml"
- "packages/agent-os/src/agent_os/policies/**"
permissions:
contents: read
jobs:
validate-policies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
- name: Install agent-os-kernel
working-directory: packages/agent-os
run: |
pip install --no-cache-dir -e ".[dev]" 2>/dev/null || pip install --no-cache-dir -e .
pip install --no-cache-dir --require-hashes \
pyyaml==6.0.2 --hash=sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563 \
2>/dev/null || pip install --no-cache-dir pyyaml==6.0.2
- name: Find and validate policy files
run: |
EXIT_CODE=0
echo "::group::Validating policy files"
for f in $(find . -name '*.yaml' -o -name '*.yml' \
| grep -i policy \
| grep -v 'charts/.*/templates/' \
| grep -v 'node_modules/' \
| sort); do
echo "--- Validating: $f ---"
python -m agent_os.policies.cli validate "$f" || EXIT_CODE=1
done
echo "::endgroup::"
exit $EXIT_CODE
test-policies:
runs-on: ubuntu-latest
needs: validate-policies
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
- name: Install agent-os-kernel
working-directory: packages/agent-os
run: |
pip install --no-cache-dir -e ".[dev]" 2>/dev/null || pip install --no-cache-dir -e .
pip install --no-cache-dir --require-hashes \
pyyaml==6.0.2 --hash=sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563 \
pytest==8.4.1 --hash=sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7 \
2>/dev/null || pip install --no-cache-dir pyyaml==6.0.2 pytest==8.4.1
- name: Run policy CLI tests
working-directory: packages/agent-os
run: pytest tests/test_policy_cli.py -v --tb=short