agentleFS
aspose-cellsaspose-cells/agentic-net-examples/encryption-and-protection/AGENTS.md

agentic-net-examples / encryption-and-protection

AGENTS.md1 starsChanged 2 months agoMITView on GitHub

Create secure, accurate Aspose.Cells for .NET examples that clearly distinguish access control, workbook/worksheet protection, write protection, file encryption, and digital signatures. Follow ../AGENTS.md. These features are not interchangeable: Never claim worksheet protection encrypts workbook contents or provides strong confidentiality. In scope: protect/unprotect workflows, locked/unlocked cells, workbook structure, open passwords, encryption providers/types, password-to-modify, signatures, certificate handling, protection verification, and security audits. Use macro-project for VBA editing, open-workbook for general loading, and document-properties for ordinary metadata. For file encryption, use the package-version-supported…

The file

We split this AGENTS.md into the rules it gives an agent

11 rules. About 5 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈5

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create secure, accurate Aspose.Cells for .NET examples that clearly distinguish access control, workbook/worksheet protection, write …

    line 19
  2. Distinctive:

    Never claim worksheet protection encrypts workbook contents or provides strong confidentiality.

    line 32
  3. Very specific:

    Use macro-project for VBA editing, open-workbook for general loading, and document-properties for ordinary metadata.

    line 38
  4. Common:

    Use placeholder passwords from environment/configuration in production-oriented examples.

    line 42
  5. Common:

    Keep demonstration passwords obviously synthetic and warn that they are not production credentials.

    line 43
  6. Common:

    Do not print passwords, private keys, certificate secrets, or decrypted content.

    line 44
  7. Distinctive:

    Use a format that supports the requested protection/encryption feature.

    line 45
  8. Distinctive:

    Never weaken encryption silently to maximize compatibility.

    line 48
  9. Common:

    Do not use a password hint that reveals the password.

    line 49
  10. Distinctive:

    Verify APIs and algorithms against the installed package and current product documentation.

    line 72
  11. Common:

    Test invalid credentials only when failure can be asserted safely.

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Encryption and Protection Agent Instructions

Mission and security boundary

Create secure, accurate Aspose.Cells for .NET examples that clearly distinguish access control, workbook/worksheet protection, write protection, file encryption, and digital signatures. Follow ../AGENTS.md.

These features are not interchangeable:

Security goalMechanism
Require a password to open a fileWorkbook file encryption/load password
Restrict worksheet actionsWorksheet.Protect with ProtectionType and allowed operations
Protect workbook structure/windowsWorkbook protection/settings APIs verified for the format
Mark or restrict modificationWrite-protection/password-to-modify APIs
Verify origin/integrityDigital signature APIs and certificates
Protect VBA projectVBA project protection/signing APIs

Never claim worksheet protection encrypts workbook contents or provides strong confidentiality.

Scope

In scope: protect/unprotect workflows, locked/unlocked cells, workbook structure, open passwords, encryption providers/types, password-to-modify, signatures, certificate handling, protection verification, and security audits.

Use macro-project for VBA editing, open-workbook for general loading, and document-properties for ordinary metadata.

Hard rules

  • Use placeholder passwords from environment/configuration in production-oriented examples; never hard-code real secrets.
  • Keep demonstration passwords obviously synthetic and warn that they are not production credentials.
  • Do not print passwords, private keys, certificate secrets, or decrypted content.
  • Use a format that supports the requested protection/encryption feature.
  • Validate by reopening with the correct password and, where safe, confirming failure with an incorrect password.
  • Explain what attackers are and are not prevented from doing.
  • Never weaken encryption silently to maximize compatibility.
  • Do not use a password hint that reveals the password.

Canonical worksheet pattern

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells["A1"].PutValue("Protected content");

worksheet.Protect(ProtectionType.All, "ExampleOnly-Password", null);
workbook.Save("protected-worksheet.xlsx");

For file encryption, use the package-version-supported load/save encryption APIs rather than repurposing worksheet protection.

Example contract

Each example must name the protected asset, threat/intent, mechanism, format, credential source, allowed operations, and verification. Use explicit types and synthetic data. Prefer filenames such as encrypt-xlsx-with-open-password.cs or protect-excel-worksheet-in-csharp.cs.

Signature examples must identify whether they add a visible signature line or a cryptographic signature. Certificate examples must use a test certificate and never assume access to a machine certificate store in CI.

Enterprise validation

  • Verify APIs and algorithms against the installed package and current product documentation.
  • Build and run without exposing secrets.
  • Reopen with valid credentials and verify protected flags/content.
  • Test invalid credentials only when failure can be asserted safely.
  • Confirm the saved format retains the intended control.
  • For signatures, verify signature validity after save and detect post-sign modification.

Reject examples that confuse protection with encryption, contain real credentials, depend silently on Windows-only certificate state, or claim compliance/certification without evidence.

SEO, GEO, and AEO

Target one direct question: "password protect Excel in C#," "encrypt XLSX without Excel," "lock cells," or "digitally sign an Excel file." The opening comment must identify the asset and mechanism. Use precise security language over marketing claims.

Related knowledge

Definition of done

The example is done when the security objective, mechanism, limitation, credential handling, format support, and verification are explicit and correct.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.