Skip to content

Add ifc label for get_me tool#2432

Merged
JoannaaKL merged 9 commits into
mainfrom
add-get_me-metadata
May 11, 2026
Merged

Add ifc label for get_me tool#2432
JoannaaKL merged 9 commits into
mainfrom
add-get_me-metadata

Conversation

@JoannaaKL
Copy link
Copy Markdown
Contributor

@JoannaaKL JoannaaKL commented May 6, 2026

Summary

Adds minimal IFC security label annotations to get_me tool output behind --insiders flag.

What changed

  • Replaced pkg/ifc/ lattice implementation with a lightweight SecurityLabel struct using Integrity and Confidentiality enums — annotation only, no lattice algebra. The enforcement engine lives in a separate service.
  • get_me sets result.Meta["ifc"] with {"integrity":"trusted","confidentiality":["public"]} when insiders mode is enabled.
  • Updated script/get-me to reliably capture and display the label.
{
   "_meta": {
    "ifc": {
      "integrity": "trusted",
      "confidentiality": [
        "public"
      ]
    }
  },
  "content": {
    "login": "JoannaaKL",
    "id": 67866556,
    "profile_url": "https://github.com/JoannaaKL",
    "avatar_url": "https://avatars.githubusercontent.com/u/67866556?v=4",
    "details": {
      "name": "JoannaaKL",
      "company": "GitHub",
    }
  }
}

MCP impact

  • Tool schema or behavior changed
    • get_me result includes _meta.ifc in insiders mode only. No change to stable behavior.

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed

@JoannaaKL JoannaaKL changed the title Add ifc labels Add ifc label for get_me tool May 6, 2026
@JoannaaKL JoannaaKL marked this pull request as ready for review May 6, 2026 14:01
@JoannaaKL JoannaaKL requested a review from a team as a code owner May 6, 2026 14:01
Copilot AI review requested due to automatic review settings May 6, 2026 14:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an IFC (Information Flow Control) label to the get_me tool’s call result metadata when InsidersMode is enabled, backed by a new pkg/ifc package implementing lattice structures and reader-based confidentiality labels.

Changes:

  • Introduces a new pkg/ifc package with core lattice types, inverse lattice support, and a reader-set powerset lattice used to construct IFC labels.
  • Adds a LabelGetMe() helper that returns a “public + trusted” readers-based security label.
  • Updates get_me to include the IFC label in CallToolResult.Meta in insiders mode, and adds a focused test to validate meta behavior.
Show a summary per file
File Description
pkg/ifc/readers_lattice.go Adds reader-set powerset lattice and ReadersSecurityLabel (incl. JSON serialization) for reader-based confidentiality.
pkg/ifc/lattice.go Adds generic lattice interfaces and basic confidentiality/integrity lattice implementations plus product/inverse lattice helpers.
pkg/ifc/labelling_engine_readers.go Adds LabelGetMe() helper for the get_me tool’s IFC label.
pkg/github/context_tools.go Conditionally attaches the IFC label to get_me call result metadata when insiders mode is enabled.
pkg/github/context_tools_test.go Adds tests asserting get_me includes/omits IFC meta depending on insiders mode.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 7

Comment thread pkg/ifc/readers_lattice.go Outdated
Comment thread pkg/ifc/readers_lattice.go Outdated
Comment thread pkg/ifc/readers_lattice.go Outdated
Comment thread pkg/ifc/readers_lattice.go Outdated
Comment thread pkg/ifc/readers_lattice.go Outdated
Comment on lines +107 to +113
result := MarshalledTextResult(minimalUser)
if deps.GetFlags(ctx).InsidersMode {
result.Meta = mcp.Meta{
"ifc": ifc.LabelGetMe(),
}
}
return result, nil, nil
Comment thread pkg/ifc/readers_lattice.go Outdated
…tion, and tests

- Fix grammar in ReadersSecurityLabelFromDict godoc
- Sort GetReaders and FiniteReaderSet.String output for determinism
- Fix godoc example to use UniversalReaders for public label
- Panic on unsupported ReaderSet types in Union/Intersection/IsSubset
- Add universe mismatch validation in PowersetLattice Join/Meet/Leq
- Add comprehensive unit tests for pkg/ifc (lattice laws, serialization, panics)
Comment thread pkg/github/context_tools.go Outdated
Comment thread pkg/ifc/labelling_engine_readers.go Outdated
Copy link
Copy Markdown
Member

@gokhanarkan gokhanarkan left a comment

Choose a reason for hiding this comment

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

Some comments to make sure we align on the spec!

@JoannaaKL JoannaaKL merged commit 1be1f38 into main May 11, 2026
18 checks passed
@JoannaaKL JoannaaKL deleted the add-get_me-metadata branch May 11, 2026 09:24
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.

5 participants