Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating OpenAI Code Analysis for identifying harmful code #4

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

ZanattaMichael
Copy link

@ZanattaMichael ZanattaMichael commented May 8, 2023

Description

This pull request adds 1 new commands to PowerShell Protect for integrating OpenAI into the platform. The new commands New-PNPAICondition with 2 conditions added. These are: AIisBestPracticeCondition and AIisSuspiciousCondition.

New Commands Added

  1. It takes in five parameters, including Property, AITemperature, AIRating, APIKey, and ContinueOnError. It then creates a new Condition object with these parameters and writes it to the output. The SecureStringExtensions class is used to convert the APIKey parameter to a base64-encoded string for added security. This cmdlet is part of the PowerShellProtect.Cmdlets namespace and can be used to integrate OpenAI into PowerShell Protect.

New Conditions Added

  1. AIisBestPracticeCondition: This condition checks whether an AI model adheres to best practices for training and deployment. It evaluates various aspects of the model, such as its accuracy, fairness, interpretability, and security, and returns a boolean value indicating whether the model meets the best practice criteria.

  2. AIisSuspiciousCondition: This condition checks whether an AI model exhibits suspicious behavior or is vulnerable to attacks. It evaluates various aspects of the model, such as its inputs, outputs, and internal workings, and returns a boolean value indicating whether the model is suspicious or not.

Usage Example

# Create a new AI condition
New-AICondition -Property isBestPractice|isSuspicious -AITemperature -1|1  -AIRating 0.5 -APIKey SecureString -ContinueOnError

Testing

Initial Testing, however AI Testing (with mocking) is not functional.

Documentation

None so far.

Contributors

  • Michael Zanatta

Michael Zanatta added 13 commits May 8, 2023 16:52
AICondition to Configuration
Added new Command
  New-AICondition
Added SecureStringHelper
Added AI Conditions
Updated Dependency Versions
Fixing Errors in Code
Updating Dependecies
@ZanattaMichael

This comment was marked as resolved.

Michael Zanatta added 10 commits May 10, 2023 21:17
Debugging AI Endpoint.
Updating Configuration
Fixing Bugs
isObfuscated Condition

Refactored OpenAI into seperate class
Added Model to configuration.
Refactoring AI logic to be include PSP non-ai conditions
Added New-AIConfiguration
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.

None yet

1 participant