Skip to content

feat: add pam agent - #351

Open
sheensantoscapadngan wants to merge 13 commits into
mainfrom
feat/add-pam-agent
Open

feat: add pam agent#351
sheensantoscapadngan wants to merge 13 commits into
mainfrom
feat/add-pam-agent

Conversation

@sheensantoscapadngan

@sheensantoscapadngan sheensantoscapadngan commented Aug 3, 2026

Copy link
Copy Markdown
Member

Description 📣

This PR adds support for PAM agent usage

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@infisical-review-police

Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-cli-351-feat-add-pam-agent

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

@sheensantoscapadngan
sheensantoscapadngan marked this pull request as ready for review August 3, 2026 18:36
Comment thread packages/pam/agent/instructions.go Outdated
Comment thread packages/pam/agent/run.go Outdated
@veria-ai

veria-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 9 · PR risk: 0/10

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds infisical pam agent connect, including manifest validation, account preflight, lazy PAM sessions, local protocol proxies, agent-specific instruction delivery, and child-process lifecycle management.

  • Adds accessible-account API models and pagination.
  • Adds per-account lazy session creation, relay/gateway transport, termination, and proxy reuse.
  • Generates agent instructions and Kubernetes configuration, then launches Claude, Codex, Gemini, or generic agents.

Confidence Score: 4/5

The unauthenticated privileged listener, unsafe context-file rewrite, and stream-truncation path should be fixed before merging.

Local host processes can currently enter the token holder's PAM sessions, project-controlled symlinks can redirect managed context writes, and legitimate TCP half-closes can terminate responses still in flight.

Files Needing Attention: packages/pam/agent/proxy.go and packages/pam/agent/adapters.go

Security Review

The new local proxies are usable by unrelated host processes without client authentication, and project-controlled context-file symlinks can redirect instruction writes outside the project.

Important Files Changed

Filename Overview
packages/pam/agent/proxy.go Adds the generic lazy PAM relay, but exposes privileged sessions to unauthenticated local clients and prematurely closes half-closed streams.
packages/pam/agent/adapters.go Adds agent-specific instruction delivery, but rewrites project-controlled context paths without symlink protection.
packages/pam/agent/session.go Implements serialized lazy session creation, reference tracking, retirement, and bounded termination draining.
packages/pam/agent/run.go Coordinates preflight, proxy startup, environment generation, child execution, logging, and concurrent cleanup.
packages/pam/agent/manifest.go Defines strict YAML decoding and validates account paths, durations, ports, duplicates, and instruction size.
packages/pam/agent/preflight.go Resolves manifest entries against paginated accessible accounts and validates launch, approval, reason, and account-type requirements.
packages/pam/local/base-proxy.go Generalizes relay and gateway dialing around explicit live sessions while preserving static interactive-proxy behavior.
packages/cmd/pam.go Wires the new agent command, validates its argument split, resolves credentials, and propagates the child exit status.
packages/api/api.go Adds the paginated accessible PAM accounts API call using the configured backend URL.
packages/api/model.go Adds typed account-listing response models used during preflight.

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Comment thread packages/pam/agent/proxy.go
Comment thread packages/pam/agent/adapters.go
Comment thread packages/pam/agent/proxy.go Outdated
Comment thread packages/pam/agent/proxy.go
Comment thread packages/pam/agent/run.go Outdated
Comment thread packages/pam/agent/accounts.go
Comment thread packages/pam/agent/run.go
Comment thread packages/cmd/pam.go Outdated
Comment thread packages/cmd/pam.go Outdated
Comment thread packages/cmd/pam.go Outdated
Comment thread packages/cmd/pam.go Outdated
Comment thread packages/cmd/pam.go Outdated
Comment thread packages/pam/agent/adapters.go
Comment thread packages/pam/agent/run.go Outdated
Comment thread packages/pam/agent/run.go Outdated
Comment thread packages/pam/agent/run.go
Comment thread packages/pam/agent/run.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant