Skip to content

feat: Add pii-ingestion-gate kit#269

Open
Pavitra-programmers wants to merge 20 commits into
Lamatic:mainfrom
Pavitra-programmers:feat/pii-ingestion-gate
Open

feat: Add pii-ingestion-gate kit#269
Pavitra-programmers wants to merge 20 commits into
Lamatic:mainfrom
Pavitra-programmers:feat/pii-ingestion-gate

Conversation

@Pavitra-programmers

@Pavitra-programmers Pavitra-programmers commented Jul 18, 2026

Copy link
Copy Markdown

PR Checklist

1. Select Contribution Type

  • Kit (kits/<category>/<kit-name>/)
  • Bundle (bundles/<bundle-name>/)
  • Template (templates/<template-name>/)

2. General Requirements

  • PR is for one project only (no unrelated changes)
  • No secrets, API keys, or real credentials are committed
  • Folder name uses kebab-case and matches the flow ID
  • All changes are documented in README.md (purpose, setup, usage)

3. File Structure (Check what applies)

  • config.json present with valid metadata (name, description, tags, steps, author, env keys)
  • All flows in flows/<flow-name>/ (where applicable) include:
    • config.json (Lamatic flow export)
    • inputs.json
    • meta.json
    • README.md
  • .env.example with placeholder values only (kits only)
  • No hand‑edited flow config.json node graphs (changes via Lamatic Studio export)

4. Validation

  • npm install && npm run dev works locally (kits: UI runs; bundles/templates: flows are valid)
  • PR title is clear (e.g., [kit] Add <name> for <use case>)
  • GitHub Actions workflows pass (all checks are green)
  • All CodeRabbit or other PR review comments are addressed and resolved
  • No unrelated files or projects are modified
  • Added new kits/pii-ingestion-gate/ kit scaffold and kit docs:
    • kits/pii-ingestion-gate/lamatic.config.ts (kit metadata + mandatory pipeline steps wiring deployed flow IDs)
    • kits/pii-ingestion-gate/README.md (purpose, setup, usage, security constraints, verification/testing guidance)
    • kits/pii-ingestion-gate/agent.md (agent/flow reference for scan + redact)
    • kits/pii-ingestion-gate/constitutions/default.md (end-to-end privacy/security rules + output constraints)
    • kits/pii-ingestion-gate/.env.example (Lamatic Studio/API + flow ID placeholders, optional GATE_ACCESS_CODE)
    • kits/pii-ingestion-gate/.gitignore
  • Added flows (flow graph + prompts + schemas are defined in the TS flow files):
    • kits/pii-ingestion-gate/flows/scan-document.ts (“scan-document”):
      • Node types: triggerNode (graphqlNode “API Request”), dynamicNode (InstructorLLMNode “Detect Sensitive Data”, dynamic LLMNode “Write Audit Summary”), responseNode (graphqlResponseNode “API Response”)
      • Edges: defaultEdge wiring trigger → instructor → LLM → response, plus trigger → response edge for response routing (responseNode edge type)
      • High-level behavior: returns { analysis, report } with structured verdict/risk/findings + an audit markdown summary; sensitive raw values are never emitted (via strict JSON schema + prompts/constitution).
    • kits/pii-ingestion-gate/flows/redact-document.ts (“redact-document”):
      • Node types: triggerNode (graphqlNode “API Request”), dynamicNode (InstructorLLMNode “Redact Sensitive Data”), responseNode (graphqlResponseNode “API Response”)
      • Edges: defaultEdge wiring trigger → instructor → response, plus responseEdge from trigger to response node
      • High-level behavior: returns { result } with redacted_document, safe_to_index, and redactions[] audit trail using typed placeholders.
  • Added prompts:
    • kits/pii-ingestion-gate/prompts/scan-document_detect-sensitive-data_system.md
    • kits/pii-ingestion-gate/prompts/scan-document_detect-sensitive-data_user.md
    • kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_system.md
    • kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_user.md
    • kits/pii-ingestion-gate/prompts/redact-document_redact-sensitive-data_system.md
    • kits/pii-ingestion-gate/prompts/redact-document_redact-sensitive-data_user.md
  • Added model-config templates (placeholders for the importing user to fill credentials/model selection):
    • kits/pii-ingestion-gate/model-configs/scan-document_detect-sensitive-data.ts
    • kits/pii-ingestion-gate/model-configs/scan-document_write-audit-summary.ts
    • kits/pii-ingestion-gate/model-configs/redact-document_redact-sensitive-data.ts
  • Added a Next.js app to invoke the deployed Lamatic flows:
    • kits/pii-ingestion-gate/apps/package.json
    • kits/pii-ingestion-gate/apps/package-lock.json
    • kits/pii-ingestion-gate/apps/tsconfig.json
    • kits/pii-ingestion-gate/apps/next.config.mjs
    • kits/pii-ingestion-gate/apps/postcss.config.mjs
    • kits/pii-ingestion-gate/apps/app/layout.tsx (metadata + root layout)
    • kits/pii-ingestion-gate/apps/app/page.tsx (Scan/Redact UI; form validation + result rendering)
    • kits/pii-ingestion-gate/apps/app/globals.css
    • kits/pii-ingestion-gate/apps/actions/orchestrate.ts (server actions scanDocument/redactDocument, shared runFlow, optional access-code authorization, input validation, rate limiting, SDK response normalization)
    • kits/pii-ingestion-gate/apps/lib/lamatic-client.ts (cached Lamatic SDK client with env validation)
    • kits/pii-ingestion-gate/apps/lib/utils.ts (cn utility)
    • kits/pii-ingestion-gate/apps/.env.example + kits/pii-ingestion-gate/apps/.gitignore
    • kits/pii-ingestion-gate/apps/components/ui/button.tsx
    • kits/pii-ingestion-gate/apps/components/ui/input.tsx
    • kits/pii-ingestion-gate/apps/components/ui/label.tsx
    • kits/pii-ingestion-gate/apps/components/ui/textarea.tsx

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

PII Ingestion Gate

Layer / File(s) Summary
Privacy policy and model instructions
kits/pii-ingestion-gate/constitutions/default.md, kits/pii-ingestion-gate/prompts/*
Defines sensitive-data categories, severity and verdict rules, redaction behavior, masking constraints, and audit-summary output requirements.
Lamatic flow definitions and kit wiring
kits/pii-ingestion-gate/flows/*, kits/pii-ingestion-gate/model-configs/*, kits/pii-ingestion-gate/lamatic.config.ts
Adds scan and redact flow graphs with structured schemas, prompt references, model slots, response mappings, and deployment configuration.
Application orchestration and interface
kits/pii-ingestion-gate/apps/actions/orchestrate.ts, kits/pii-ingestion-gate/apps/lib/*, kits/pii-ingestion-gate/apps/components/ui/*, kits/pii-ingestion-gate/apps/app/*
Connects protected server actions to Lamatic flows and provides a Next.js interface for scanning, redacting, displaying findings, and copying redacted text.
Application build and environment setup
kits/pii-ingestion-gate/apps/package.json, kits/pii-ingestion-gate/apps/tsconfig.json, kits/pii-ingestion-gate/apps/*.mjs, kits/pii-ingestion-gate/apps/.*ignore, kits/pii-ingestion-gate/apps/.env.example
Adds Next.js dependencies, build tooling, TypeScript and PostCSS settings, environment templates, and ignored development artifacts.
Kit documentation and root environment templates
kits/pii-ingestion-gate/README.md, kits/pii-ingestion-gate/agent.md, kits/pii-ingestion-gate/.env.example, kits/pii-ingestion-gate/.gitignore
Documents flow contracts, setup, guardrails, expected outcomes, failure modes, and required environment variables.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately describes the main change: adding the pii-ingestion-gate kit.
Description check ✅ Passed The PR description follows the checklist structure and covers the required sections with mostly complete details.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Pavitra-programmers Pavitra-programmers changed the title Feat/pii ingestion gate feat: Add pii-ingestion-gate kit Jul 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Kit: kits/pii-ingestion-gate

Check Results

Check Status
No edits to existing kits ✅ Pass
Required root files present ✅ Pass
Flow .ts files present ✅ Pass
lamatic.config.ts valid ✅ Pass
No changes outside kits/ ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 16

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_user.md (1)

1-4: 🩺 Stability & Availability | 🔵 Trivial

Monitor output size for context limits.

Greetings, agent. Your mission, should you choose to accept it, involves monitoring the size of the InstructorLLMNode_301.output payload in production. If the scanned document is massive, this JSON structure could exceed the context window of our downstream analysis model. Consider adding a length check or chunking strategy upstream to prevent our operations from being compromised. This message will self-destruct in five seconds.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_user.md`
around lines 1 - 4, Limit the size of the InstructorLLMNode_301.output payload
before it is interpolated into the audit-summary prompt. Add an upstream length
check or chunking strategy that keeps each downstream analysis request within
the model’s context window while preserving complete processing of oversized
scanned documents.
kits/pii-ingestion-gate/prompts/redact-document_redact-sensitive-data_system.md (1)

22-25: 🔒 Security & Privacy | 🔵 Trivial

Establish a downstream protocol for live credentials.

Agent, a critical briefing: if the redaction engine flags a live API key in the notes, we need a rapid-response protocol in the field to automatically intercept and rotate it. Relying on manual review could give the syndicate enough time to infiltrate our systems. I advise setting up an automated alert trigger based on these notes in the orchestration layer.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/pii-ingestion-gate/prompts/redact-document_redact-sensitive-data_system.md`
around lines 22 - 25, Update the redaction workflow around the safe_to_index and
notes output fields to establish the downstream live-credential protocol: ensure
notes clearly flag detected live API keys with actionable context, and expose
that signal in the structured response for orchestration to automatically alert
and initiate credential interception and rotation. Preserve the existing
schema-only response requirement.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kits/pii-ingestion-gate/.gitignore`:
- Around line 3-5: Update the .gitignore environment-file rules to ignore all
.env variants recursively, including files such as apps/.env.production and
apps/.env.development, while explicitly unignoring the intended example
template. Preserve the existing local-environment exclusions.

In `@kits/pii-ingestion-gate/apps/actions/orchestrate.ts`:
- Line 3: Update the orchestration flow to import and use the parent kit’s
../../lamatic.config step definitions instead of duplicating flow configuration
through environment variables; revise the flow wiring in the action logic around
the affected lines while preserving the existing execution behavior.
- Around line 51-55: Prevent parsed audit reports from being rendered as raw
React children: in kits/pii-ingestion-gate/apps/actions/orchestrate.ts lines
51-55, preserve report as text or return a typed report shape; in
kits/pii-ingestion-gate/apps/app/page.tsx lines 306-313, serialize structured
reports before rendering. Use the existing data normalization flow and ensure
both string and structured report values render safely.
- Around line 72-97: Update the scanDocument and redactDocument server actions
to require authenticated authorization before invoking runFlow, and enforce
per-user or per-request rate limits using the project’s existing authorization
and throttling mechanisms. Reject unauthorized or rate-limited requests without
submitting document data, while preserving the existing flow IDs and action
result behavior for permitted requests.

In `@kits/pii-ingestion-gate/apps/app/globals.css`:
- Around line 8-10: Update the body styling in globals.css to define and consume
CSS custom properties for the background and text colors instead of using
hardcoded color values directly. Keep the existing visual colors unchanged while
moving them into reusable variables.

In `@kits/pii-ingestion-gate/apps/app/page.tsx`:
- Around line 396-398: The footer text in the page component makes an
unsupported claim about document storage. Update the footer to state only that
this app does not store document content locally, and add a link to the
applicable Lamatic/provider retention or privacy policy for downstream handling.
- Around line 100-247: The Home component’s document form must use the required
react-hook-form, Zod, and shadcn/ui stack instead of manual input state and
validation. In kits/pii-ingestion-gate/apps/app/page.tsx lines 100-247, define a
Zod schema, wire the Document and Policy fields through react-hook-form, display
schema validation through shadcn/ui form controls, and preserve the existing
run, sample-loading, tab, and error behavior. In
kits/pii-ingestion-gate/apps/package.json lines 11-28, add the required
react-hook-form and Zod dependencies.
- Around line 201-225: Associate the “Document” and “Policy” labels with their
controls by adding stable, unique IDs to the textarea and input and matching
those IDs through each label’s htmlFor attribute. Update only the field markup
around the document and policy controls, preserving existing behavior and
styling.

In `@kits/pii-ingestion-gate/apps/next.config.mjs`:
- Around line 3-4: Remove the ignoreBuildErrors and ignoreDuringBuilds settings
from the next.config.mjs TypeScript and ESLint configuration. In tsconfig.json,
enable strict checking and resolve all resulting type contract errors so both
build-time TypeScript and ESLint failures are enforced.

In `@kits/pii-ingestion-gate/apps/package.json`:
- Line 13: Update the lamatic dependency in apps/package.json from latest to a
reviewed fixed version or approved version range, keeping the dependency
declaration otherwise unchanged.

In `@kits/pii-ingestion-gate/constitutions/default.md`:
- Around line 53-54: Capitalize “Markdown” consistently in the specified
directives: update “markdown code fences” in
kits/pii-ingestion-gate/constitutions/default.md lines 53-54, “markdown fences”
in kits/pii-ingestion-gate/prompts/scan-document_detect-sensitive-data_system.md
line 39, and “Plain markdown” in
kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_system.md line
9 to use “Markdown”.

In `@kits/pii-ingestion-gate/flows/scan-document.ts`:
- Around line 64-66: Populate githubUrl, documentationUrl, and deployUrl in the
metadata for scan-document.ts (lines 64-66) and redact-document.ts (lines 61-63)
with the correct flow URLs before deployment.

In
`@kits/pii-ingestion-gate/model-configs/scan-document_detect-sensitive-data.ts`:
- Around line 11-13: Update the configName field in the scan-document
sensitive-data model configuration from the generic "configA" placeholder to a
descriptive unique name such as "detect-sensitive-data-config", while leaving
params and model_name unchanged.

In
`@kits/pii-ingestion-gate/prompts/scan-document_detect-sensitive-data_system.md`:
- Line 9: Update the financial-data description in the prompt to replace “IBAN
numbers” with “IBANs,” while preserving the surrounding credit/debit card, bank
account, and salary references.

In `@kits/pii-ingestion-gate/README.md`:
- Around line 116-118: The quickstart documentation incorrectly sends blocked
results to Redact; update the sample flow in kits/pii-ingestion-gate/README.md
lines 116-118 and kits/pii-ingestion-gate/agent.md lines 60-62 to use a
needs_redaction verdict for redaction, or explicitly reject blocked results
before any sanitization. Keep both quickstarts consistent with the
blocked-document guardrail.
- Line 77: Update the opening fenced code block in the README to include an
explicit language label, preferably text, so the repository tree block satisfies
markdownlint MD040.

---

Outside diff comments:
In
`@kits/pii-ingestion-gate/prompts/redact-document_redact-sensitive-data_system.md`:
- Around line 22-25: Update the redaction workflow around the safe_to_index and
notes output fields to establish the downstream live-credential protocol: ensure
notes clearly flag detected live API keys with actionable context, and expose
that signal in the structured response for orchestration to automatically alert
and initiate credential interception and rotation. Preserve the existing
schema-only response requirement.

In `@kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_user.md`:
- Around line 1-4: Limit the size of the InstructorLLMNode_301.output payload
before it is interpolated into the audit-summary prompt. Add an upstream length
check or chunking strategy that keeps each downstream analysis request within
the model’s context window while preserving complete processing of oversized
scanned documents.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: f7cc4072-1485-4573-9627-07fa4cb17e51

📥 Commits

Reviewing files that changed from the base of the PR and between 0ada432 and 4a63e12.

⛔ Files ignored due to path filters (1)
  • kits/pii-ingestion-gate/apps/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (28)
  • kits/pii-ingestion-gate/.env.example
  • kits/pii-ingestion-gate/.gitignore
  • kits/pii-ingestion-gate/README.md
  • kits/pii-ingestion-gate/agent.md
  • kits/pii-ingestion-gate/apps/.env.example
  • kits/pii-ingestion-gate/apps/.gitignore
  • kits/pii-ingestion-gate/apps/actions/orchestrate.ts
  • kits/pii-ingestion-gate/apps/app/globals.css
  • kits/pii-ingestion-gate/apps/app/layout.tsx
  • kits/pii-ingestion-gate/apps/app/page.tsx
  • kits/pii-ingestion-gate/apps/lib/lamatic-client.ts
  • kits/pii-ingestion-gate/apps/next.config.mjs
  • kits/pii-ingestion-gate/apps/package.json
  • kits/pii-ingestion-gate/apps/postcss.config.mjs
  • kits/pii-ingestion-gate/apps/tsconfig.json
  • kits/pii-ingestion-gate/constitutions/default.md
  • kits/pii-ingestion-gate/flows/redact-document.ts
  • kits/pii-ingestion-gate/flows/scan-document.ts
  • kits/pii-ingestion-gate/lamatic.config.ts
  • kits/pii-ingestion-gate/model-configs/redact-document_redact-sensitive-data.ts
  • kits/pii-ingestion-gate/model-configs/scan-document_detect-sensitive-data.ts
  • kits/pii-ingestion-gate/model-configs/scan-document_write-audit-summary.ts
  • kits/pii-ingestion-gate/prompts/redact-document_redact-sensitive-data_system.md
  • kits/pii-ingestion-gate/prompts/redact-document_redact-sensitive-data_user.md
  • kits/pii-ingestion-gate/prompts/scan-document_detect-sensitive-data_system.md
  • kits/pii-ingestion-gate/prompts/scan-document_detect-sensitive-data_user.md
  • kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_system.md
  • kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_user.md

Comment thread kits/pii-ingestion-gate/.gitignore Outdated
Comment thread kits/pii-ingestion-gate/apps/actions/orchestrate.ts
Comment thread kits/pii-ingestion-gate/apps/actions/orchestrate.ts
Comment thread kits/pii-ingestion-gate/apps/actions/orchestrate.ts
Comment thread kits/pii-ingestion-gate/apps/app/globals.css Outdated
Comment thread kits/pii-ingestion-gate/flows/scan-document.ts Outdated
Comment thread kits/pii-ingestion-gate/prompts/scan-document_detect-sensitive-data_system.md Outdated
Comment thread kits/pii-ingestion-gate/README.md Outdated
Comment thread kits/pii-ingestion-gate/README.md Outdated
@coderabbitai
coderabbitai Bot requested review from amanintech and d-pamneja July 18, 2026 08:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (3)
kits/pii-ingestion-gate/apps/actions/orchestrate.ts (2)

73-97: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Secure the privileged flow actions before deployment.

Agent, we have an unsecured channel! Any operative can currently invoke these server actions using the project API key, allowing anonymous quota exhaustion and arbitrary PII submission. Your mission is to require authentication and enforce per-user/request rate limits before this intel gets into the wrong hands.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/pii-ingestion-gate/apps/actions/orchestrate.ts` around lines 73 - 97,
Secure the scanDocument and redactDocument server actions by requiring an
authenticated caller before invoking runFlow, and enforce the project’s existing
per-user/request rate-limiting mechanism for each request. Reject
unauthenticated or rate-limited calls without submitting the document, while
preserving the current flow IDs, payloads, and ActionResult behavior for
authorized requests.

73-97: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Mission directive: derive flow wiring from ../../lamatic.config.

Agent, your mission, should you choose to accept it, is to import and use the parent kit’s ../../lamatic.config step definitions instead of duplicating flow configuration through environment variables. This is a strict mission parameter from headquarters.

As per coding guidelines, "Kit Next.js apps must import and use ../../lamatic.config to read step definitions from the parent kit."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/pii-ingestion-gate/apps/actions/orchestrate.ts` around lines 73 - 97,
Update scanDocument and redactDocument to derive their flow definitions from the
parent kit’s ../../lamatic.config instead of process.env flow IDs. Import the
configuration and pass the corresponding configured step definitions into
runFlow, removing the environment-variable wiring while preserving the existing
document and policy inputs.

Source: Coding guidelines

kits/pii-ingestion-gate/apps/app/page.tsx (1)

100-255: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

The document form bypasses the required form/component stack.

Agent, headquarters requires standard-issue gear for this operation. The current form relies on makeshift state (useState) instead of the officially sanctioned react-hook-form, Zod, and shadcn/ui controls.

As per coding guidelines, kit apps must use "shadcn/ui components, react-hook-form + zod for forms". Please equip this form with the proper toolkit to complete the mission.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/pii-ingestion-gate/apps/app/page.tsx` around lines 100 - 255, The Home
component’s document and policy form uses local useState and native controls
instead of the required react-hook-form, Zod, and shadcn/ui stack. Define a Zod
schema for the document and optional policy, initialize react-hook-form in Home,
and replace the textarea, input, validation, and submit flow with the
corresponding shadcn/ui Form, FormField, FormItem, FormLabel, FormControl, and
FormMessage components while preserving scan/redact behavior and sample loading.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@kits/pii-ingestion-gate/apps/actions/orchestrate.ts`:
- Around line 73-97: Secure the scanDocument and redactDocument server actions
by requiring an authenticated caller before invoking runFlow, and enforce the
project’s existing per-user/request rate-limiting mechanism for each request.
Reject unauthenticated or rate-limited calls without submitting the document,
while preserving the current flow IDs, payloads, and ActionResult behavior for
authorized requests.
- Around line 73-97: Update scanDocument and redactDocument to derive their flow
definitions from the parent kit’s ../../lamatic.config instead of process.env
flow IDs. Import the configuration and pass the corresponding configured step
definitions into runFlow, removing the environment-variable wiring while
preserving the existing document and policy inputs.

In `@kits/pii-ingestion-gate/apps/app/page.tsx`:
- Around line 100-255: The Home component’s document and policy form uses local
useState and native controls instead of the required react-hook-form, Zod, and
shadcn/ui stack. Define a Zod schema for the document and optional policy,
initialize react-hook-form in Home, and replace the textarea, input, validation,
and submit flow with the corresponding shadcn/ui Form, FormField, FormItem,
FormLabel, FormControl, and FormMessage components while preserving scan/redact
behavior and sample loading.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: c7c3c31d-9c9d-405c-a51b-28166ab39c2d

📥 Commits

Reviewing files that changed from the base of the PR and between 4a63e12 and e6a5b13.

⛔ Files ignored due to path filters (1)
  • kits/pii-ingestion-gate/apps/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (14)
  • kits/pii-ingestion-gate/.gitignore
  • kits/pii-ingestion-gate/README.md
  • kits/pii-ingestion-gate/agent.md
  • kits/pii-ingestion-gate/apps/.gitignore
  • kits/pii-ingestion-gate/apps/actions/orchestrate.ts
  • kits/pii-ingestion-gate/apps/app/globals.css
  • kits/pii-ingestion-gate/apps/app/page.tsx
  • kits/pii-ingestion-gate/apps/package.json
  • kits/pii-ingestion-gate/constitutions/default.md
  • kits/pii-ingestion-gate/flows/redact-document.ts
  • kits/pii-ingestion-gate/flows/scan-document.ts
  • kits/pii-ingestion-gate/prompts/redact-document_redact-sensitive-data_system.md
  • kits/pii-ingestion-gate/prompts/scan-document_detect-sensitive-data_system.md
  • kits/pii-ingestion-gate/prompts/scan-document_write-audit-summary_system.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kits/pii-ingestion-gate/.env.example`:
- Around line 9-11: Update the GATE_ACCESS_CODE configuration and its handling
in assertAuthorized so production or public deployments fail closed instead of
allowing an unset code to bypass authorization. Require a non-empty access code
by default, while preserving an explicit configuration path for trusted private
environments that intentionally disable public access.

In `@kits/pii-ingestion-gate/apps/actions/orchestrate.ts`:
- Around line 21-47: The in-memory requestLog rate limiter is not shared or
durable across serverless instances. Update withinRateLimit and its requestLog
integration to use a centralized Redis-backed store, preserving the existing
clientKey-based sliding-window limits and allowing the required asynchronous
operations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: f2a57f3e-6ba8-4115-9b19-3218ded6ddef

📥 Commits

Reviewing files that changed from the base of the PR and between e6a5b13 and 7cdfcfb.

⛔ Files ignored due to path filters (1)
  • kits/pii-ingestion-gate/apps/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • kits/pii-ingestion-gate/.env.example
  • kits/pii-ingestion-gate/README.md
  • kits/pii-ingestion-gate/agent.md
  • kits/pii-ingestion-gate/apps/.env.example
  • kits/pii-ingestion-gate/apps/actions/orchestrate.ts
  • kits/pii-ingestion-gate/apps/app/page.tsx
  • kits/pii-ingestion-gate/apps/components/ui/button.tsx
  • kits/pii-ingestion-gate/apps/components/ui/input.tsx
  • kits/pii-ingestion-gate/apps/components/ui/label.tsx
  • kits/pii-ingestion-gate/apps/components/ui/textarea.tsx
  • kits/pii-ingestion-gate/apps/lib/utils.ts
  • kits/pii-ingestion-gate/apps/next.config.mjs
  • kits/pii-ingestion-gate/apps/package.json
  • kits/pii-ingestion-gate/apps/tsconfig.json
  • kits/pii-ingestion-gate/flows/redact-document.ts
  • kits/pii-ingestion-gate/flows/scan-document.ts
  • kits/pii-ingestion-gate/model-configs/redact-document_redact-sensitive-data.ts
  • kits/pii-ingestion-gate/model-configs/scan-document_detect-sensitive-data.ts
  • kits/pii-ingestion-gate/model-configs/scan-document_write-audit-summary.ts
💤 Files with no reviewable changes (1)
  • kits/pii-ingestion-gate/apps/next.config.mjs

Comment thread kits/pii-ingestion-gate/.env.example
Comment thread kits/pii-ingestion-gate/apps/actions/orchestrate.ts
@Pavitra-programmers

Copy link
Copy Markdown
Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved and changes approved.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @Pavitra-programmers! 👋

Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review.

Steps to follow:

  1. Read through all CodeRabbit comments carefully
  2. Address each issue raised (or reply explaining why you disagree)
  3. Push your fixes as new commits
  4. Once all issues are resolved, comment here so we can re-review

This helps keep the review process efficient for everyone. Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant